home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / dec8.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  114KB  |  3,169 lines

  1. /***************************************************************************
  2.  
  3. Various Data East 8 bit games:
  4.  
  5.     Cobra Command (World)       (c) 1988 Data East Corporation (6809)
  6.     Cobra Command (Japan)       (c) 1988 Data East Corporation (6809)
  7.     The Real Ghostbusters (2p)  (c) 1987 Data East USA (6809 + I8751)
  8.     The Real Ghostbusters (3p)  (c) 1987 Data East USA (6809 + I8751)
  9.     Meikyuu Hunter G            (c) 1987 Data East Corporation (6809 + I8751)
  10.     Super Real Darwin           (c) 1987 Data East Corporation (6809 + I8751)
  11.     Psycho-Nics Oscar           (c) 1988 Data East USA (2*6809 + I8751)
  12.     Psycho-Nics Oscar (Japan)   (c) 1987 Data East Corporation (2*6809 + I8751)
  13.     Gondomania                  (c) 1987 Data East USA (6809 + I8751)
  14.     Makyou Senshi               (c) 1987 Data East Corporation (6809 + I8751)
  15.     Last Mission (rev 6)        (c) 1986 Data East USA (2*6809 + I8751)
  16.     Last Mission (rev 5)        (c) 1986 Data East USA (2*6809 + I8751)
  17.     Shackled                    (c) 1986 Data East USA (2*6809 + I8751)
  18.     Breywood                    (c) 1986 Data East Corporation (2*6809 + I8751)
  19.     Captain Silver (Japan)      (c) 1987 Data East Corporation (2*6809 + I8751)
  20.     Garyo Retsuden (Japan)      (c) 1987 Data East Corporation (6809 + I8751)
  21.  
  22.     All games use a 6502 for sound (some are encrypted), all games except Cobracom
  23.     use an Intel 8751 for protection & coinage.  For these games the coinage dip
  24.     switch is not currently supported, they are fixed at 1 coin 1 credit.
  25.  
  26.     Meikyuu Hunter G was formerly known as Mazehunter.
  27.  
  28.     Emulation by Bryan McPhail, mish@tendril.co.uk
  29.  
  30. To do:
  31.     Weird cpu race condition in Last Mission.
  32.     Support coinage options for all i8751 emulations.
  33.     Dips needed to be worked on several games
  34.     Super Real Darwin 'Double' sprites appearing from the top of the screen are clipped
  35.     Strangely coloured butterfly on Garyo Retsuden water levels!
  36.  
  37.   Thanks to José Miguel Morales Farreras for Super Real Darwin information!
  38.  
  39. ***************************************************************************/
  40.  
  41. #include "driver.h"
  42. #include "vidhrdw/generic.h"
  43. #include "cpu/m6809/m6809.h"
  44. #include "cpu/m6502/m6502.h"
  45.  
  46. void ghostb_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  47. void cobracom_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  48. void ghostb_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  49. void srdarwin_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  50. void gondo_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  51. void garyoret_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  52. void lastmiss_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  53. void shackled_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  54. void oscar_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  55. int cobracom_vh_start(void);
  56. int oscar_vh_start(void);
  57. int ghostb_vh_start(void);
  58. int lastmiss_vh_start(void);
  59. int shackled_vh_start(void);
  60. int srdarwin_vh_start(void);
  61. int gondo_vh_start(void);
  62. int garyoret_vh_start(void);
  63.  
  64. WRITE_HANDLER( dec8_bac06_0_w );
  65. WRITE_HANDLER( dec8_bac06_1_w );
  66. WRITE_HANDLER( dec8_pf0_data_w );
  67. WRITE_HANDLER( dec8_pf1_data_w );
  68. READ_HANDLER( dec8_pf0_data_r );
  69. READ_HANDLER( dec8_pf1_data_r );
  70. WRITE_HANDLER( srdarwin_videoram_w );
  71. WRITE_HANDLER( dec8_scroll1_w );
  72. WRITE_HANDLER( dec8_scroll2_w );
  73. WRITE_HANDLER( srdarwin_control_w );
  74. WRITE_HANDLER( gondo_scroll_w );
  75. WRITE_HANDLER( lastmiss_control_w );
  76. WRITE_HANDLER( lastmiss_scrollx_w );
  77. WRITE_HANDLER( lastmiss_scrolly_w );
  78. WRITE_HANDLER( dec8_bac06_0_w );
  79. WRITE_HANDLER( dec8_bac06_1_w );
  80. WRITE_HANDLER( dec8_flipscreen_w );
  81. WRITE_HANDLER( dec8_videoram_w );
  82.  
  83. /******************************************************************************/
  84.  
  85. static unsigned char *dec8_shared_ram,*dec8_shared2_ram;
  86. extern unsigned char *dec8_pf0_data,*dec8_pf1_data,*dec8_row;
  87.  
  88. static int nmi_enable,int_enable;
  89. static int i8751_return, i8751_value;
  90. static int msm5205next;
  91.  
  92. /******************************************************************************/
  93.  
  94. /* Only used by ghostb, gondo, garyoret, other games can control buffering */
  95. static void dec8_eof_callback(void)
  96. {
  97.     buffer_spriteram_w(0,0);
  98. }
  99.  
  100. static READ_HANDLER( i8751_h_r )
  101. {
  102.     return i8751_return>>8; /* MSB */
  103. }
  104.  
  105. static READ_HANDLER( i8751_l_r )
  106. {
  107.     return i8751_return&0xff; /* LSB */
  108. }
  109.  
  110. static WRITE_HANDLER( i8751_reset_w )
  111. {
  112.     i8751_return=0;
  113. }
  114.  
  115. /******************************************************************************/
  116.  
  117. static READ_HANDLER( gondo_player_1_r )
  118. {
  119.     switch (offset) {
  120.         case 0: /* Rotary low byte */
  121.             return ~((1 << (readinputport(5) * 12 / 256))&0xff);
  122.         case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
  123.             return ((~((1 << (readinputport(5) * 12 / 256))>>4))&0xf0) | (readinputport(0)&0xf);
  124.     }
  125.     return 0xff;
  126. }
  127.  
  128. static READ_HANDLER( gondo_player_2_r )
  129. {
  130.     switch (offset) {
  131.         case 0: /* Rotary low byte */
  132.             return ~((1 << (readinputport(6) * 12 / 256))&0xff);
  133.         case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
  134.             return ((~((1 << (readinputport(6) * 12 / 256))>>4))&0xf0) | (readinputport(1)&0xf);
  135.     }
  136.     return 0xff;
  137. }
  138.  
  139. /******************************************************************************/
  140.  
  141. static WRITE_HANDLER( ghostb_i8751_w )
  142. {
  143.     i8751_return=0;
  144.  
  145.     switch (offset) {
  146.     case 0: /* High byte */
  147.         i8751_value=(i8751_value&0xff) | (data<<8);
  148.         break;
  149.     case 1: /* Low byte */
  150.         i8751_value=(i8751_value&0xff00) | data;
  151.         break;
  152.     }
  153.  
  154.     if (i8751_value==0x00aa) i8751_return=0x655;
  155.     if (i8751_value==0x021a) i8751_return=0x6e5; /* Ghostbusters ID */
  156.     if (i8751_value==0x021b) i8751_return=0x6e4; /* Meikyuu Hunter G ID */
  157. }
  158.  
  159. static WRITE_HANDLER( srdarwin_i8751_w )
  160. {
  161.     static int coins,latch;
  162.     i8751_return=0;
  163.  
  164.     switch (offset) {
  165.     case 0: /* High byte */
  166.         i8751_value=(i8751_value&0xff) | (data<<8);
  167.         break;
  168.     case 1: /* Low byte */
  169.         i8751_value=(i8751_value&0xff00) | data;
  170.         break;
  171.     }
  172.  
  173.     if (i8751_value==0x0000) {i8751_return=0;coins=0;}
  174.     if (i8751_value==0x3063) i8751_return=0x9c; /* Protection */
  175.     if ((i8751_value&0xff00)==0x4000) i8751_return=i8751_value; /* Coinage settings */
  176.      if (i8751_value==0x5000) i8751_return=((coins / 10) << 4) | (coins % 10); /* Coin request */
  177.      if (i8751_value==0x6000) {i8751_value=-1; coins--; } /* Coin clear */
  178.     /* Nb:  Command 0x4000 for setting coinage options is not supported */
  179.      if ((readinputport(4)&1)==1) latch=1;
  180.      if ((readinputport(4)&1)!=1 && latch) {coins++; latch=0;}
  181.  
  182.     /* This next value is the index to a series of tables,
  183.     each table controls the end of level bad guy, wrong values crash the
  184.     cpu right away via a bogus jump.
  185.  
  186.     Level number requested is in low byte
  187.  
  188.     Addresses on left hand side are from the protection vector table which is
  189.     stored at location 0xf580 in rom dy_01.rom
  190.  
  191. ba5e (lda #00) = Level 0?
  192. ba82 (lda #01) = Pyramid boss, Level 1?
  193. baaa           = No boss appears, game hangs
  194. bacc (lda #04) = Killer Bee boss, Level 4?
  195. bae0 (lda #03) = Snake type boss, Level 3?
  196. baf9           = Double grey thing boss...!
  197. bb0a             = Single grey thing boss!
  198. bb18 (lda #00) = Hailstorm from top of screen.
  199. bb31 (lda #28) = Small hailstorm
  200. bb47 (ldb #05) = Small hailstorm
  201. bb5a (lda #08) = Weird square things..
  202. bb63           = Square things again
  203. (24)           = Another square things boss..
  204. (26)           = Clock boss! (level 3)
  205. (28)           = Big dragon boss, perhaps an end-of-game baddy
  206. (30)           = 4 things appear at corners, seems to fit with attract mode (level 1)
  207. (32)           = Grey things teleport onto screen..
  208. (34)           = Grey thing appears in middle of screen
  209. (36)           = As above
  210. (38)           = Circle thing with two pincers
  211. (40)           = Grey bird
  212. (42)           = Crash (end of table)
  213.  
  214.     The table below is hopefully correct thanks to José Miguel Morales Farreras,
  215.     but Boss #6 is uncomfirmed as correct.
  216.  
  217. */
  218.     if (i8751_value==0x8000) i8751_return=0xf580 +  0; /* Boss #1: Snake + Bee */
  219.     if (i8751_value==0x8001) i8751_return=0xf580 + 30; /* Boss #2: 4 Corners */
  220.     if (i8751_value==0x8002) i8751_return=0xf580 + 26; /* Boss #3: Clock */
  221.     if (i8751_value==0x8003) i8751_return=0xf580 +  6; /* Boss #4: Pyramid */
  222.     if (i8751_value==0x8004) i8751_return=0xf580 + 12; /* Boss #5: Grey things */
  223.     if (i8751_value==0x8005) i8751_return=0xf580 + 20; /* Boss #6: Ground Base?! */
  224.     if (i8751_value==0x8006) i8751_return=0xf580 + 28; /* Boss #7: Dragon */
  225.     if (i8751_value==0x8007) i8751_return=0xf580 + 32; /* Boss #8: Teleport */
  226.     if (i8751_value==0x8008) i8751_return=0xf580 + 38; /* Boss #9: Octopus (Pincer) */
  227.     if (i8751_value==0x8009) i8751_return=0xf580 + 40; /* Boss #10: Bird */
  228. }
  229.  
  230. static WRITE_HANDLER( gondo_i8751_w )
  231. {
  232.     static int coin1,coin2,latch,snd;
  233.     i8751_return=0;
  234.  
  235.     switch (offset) {
  236.     case 0: /* High byte */
  237.         i8751_value=(i8751_value&0xff) | (data<<8);
  238.         if (int_enable) cpu_cause_interrupt (0, M6809_INT_IRQ); /* IRQ on *high* byte only */
  239.         break;
  240.     case 1: /* Low byte */
  241.         i8751_value=(i8751_value&0xff00) | data;
  242.         break;
  243.     }
  244.  
  245.     /* Coins are controlled by the i8751 */
  246.      if ((readinputport(4)&3)==3) latch=1;
  247.      if ((readinputport(4)&1)!=1 && latch) {coin1++; snd=1; latch=0;}
  248.      if ((readinputport(4)&2)!=2 && latch) {coin2++; snd=1; latch=0;}
  249.  
  250.     /* Work out return values */
  251.     if (i8751_value==0x0000) {i8751_return=0; coin1=coin2=snd=0;}
  252.     if (i8751_value==0x038a)  i8751_return=0x375; /* Makyou Senshi ID */
  253.     if (i8751_value==0x038b)  i8751_return=0x374; /* Gondomania ID */
  254.     if ((i8751_value>>8)==0x04)  i8751_return=0x40f; /* Coinage settings (Not supported) */
  255.     if ((i8751_value>>8)==0x05) {i8751_return=0x500 | ((coin1 / 10) << 4) | (coin1 % 10);  } /* Coin 1 */
  256.     if ((i8751_value>>8)==0x06 && coin1 && !offset) {i8751_return=0x600; coin1--; } /* Coin 1 clear */
  257.     if ((i8751_value>>8)==0x07) {i8751_return=0x700 | ((coin2 / 10) << 4) | (coin2 % 10);  } /* Coin 2 */
  258.     if ((i8751_value>>8)==0x08 && coin2 && !offset) {i8751_return=0x800; coin2--; } /* Coin 2 clear */
  259.     /* Commands 0x9xx do nothing */
  260.     if ((i8751_value>>8)==0x0a) {i8751_return=0xa00 | snd; if (snd) snd=0; }
  261. }
  262.  
  263. static WRITE_HANDLER( shackled_i8751_w )
  264. {
  265.     static int coin1,coin2,latch=0;
  266.     i8751_return=0;
  267.  
  268.     switch (offset) {
  269.     case 0: /* High byte */
  270.         i8751_value=(i8751_value&0xff) | (data<<8);
  271.         cpu_cause_interrupt (1, M6809_INT_FIRQ); /* Signal main cpu */
  272.         break;
  273.     case 1: /* Low byte */
  274.         i8751_value=(i8751_value&0xff00) | data;
  275.         break;
  276.     }
  277.  
  278.     /* Coins are controlled by the i8751 */
  279.      if (/*(readinputport(2)&3)==3*/!latch) {latch=1;coin1=coin2=0;}
  280.      if ((readinputport(2)&1)!=1 && latch) {coin1=1; latch=0;}
  281.      if ((readinputport(2)&2)!=2 && latch) {coin2=1; latch=0;}
  282.  
  283.     if (i8751_value==0x0050) i8751_return=0; /* Breywood ID */
  284.     if (i8751_value==0x0051) i8751_return=0; /* Shackled ID */
  285.     if (i8751_value==0x0102) i8751_return=0; /* ?? */
  286.     if (i8751_value==0x0101) i8751_return=0; /* ?? */
  287.     if (i8751_value==0x8101) i8751_return=((coin2 / 10) << 4) | (coin2 % 10) |
  288.             ((((coin1 / 10) << 4) | (coin1 % 10))<<8); /* Coins */
  289. }
  290.  
  291. static WRITE_HANDLER( lastmiss_i8751_w )
  292. {
  293.     static int coin,latch=0,snd;
  294.     i8751_return=0;
  295.  
  296.     switch (offset) {
  297.     case 0: /* High byte */
  298.         i8751_value=(i8751_value&0xff) | (data<<8);
  299.         cpu_cause_interrupt (0, M6809_INT_FIRQ); /* Signal main cpu */
  300.         break;
  301.     case 1: /* Low byte */
  302.         i8751_value=(i8751_value&0xff00) | data;
  303.         break;
  304.     }
  305.  
  306.     /* Coins are controlled by the i8751 */
  307.      if ((readinputport(2)&3)==3 && !latch) latch=1;
  308.      if ((readinputport(2)&3)!=3 && latch) {coin++; latch=0;snd=0x400;i8751_return=0x400;return;}
  309.  
  310.     if (i8751_value==0x007b) i8751_return=0x0184; //???
  311.     if (i8751_value==0x0000) {i8751_return=0x0184; coin=snd=0;}//???
  312.     if (i8751_value==0x0401) i8751_return=0x0184; //???
  313.     if ((i8751_value>>8)==0x01) i8751_return=0x0184; /* Coinage setup */
  314.     if ((i8751_value>>8)==0x02) {i8751_return=snd | ((coin / 10) << 4) | (coin % 10); snd=0;} /* Coin return */
  315.     if ((i8751_value>>8)==0x03) {i8751_return=0; coin--; } /* Coin clear */
  316. }
  317.  
  318. static WRITE_HANDLER( csilver_i8751_w )
  319. {
  320.     static int coin,latch=0,snd;
  321.     i8751_return=0;
  322.  
  323.     switch (offset) {
  324.     case 0: /* High byte */
  325.         i8751_value=(i8751_value&0xff) | (data<<8);
  326.         cpu_cause_interrupt (0, M6809_INT_FIRQ); /* Signal main cpu */
  327.         break;
  328.     case 1: /* Low byte */
  329.         i8751_value=(i8751_value&0xff00) | data;
  330.         break;
  331.     }
  332.  
  333.     /* Coins are controlled by the i8751 */
  334.      if ((readinputport(2)&3)==3 && !latch) latch=1;
  335.      if ((readinputport(2)&3)!=3 && latch) {coin++; latch=0;snd=0x1200; i8751_return=0x1200;return;}
  336.  
  337.     if (i8751_value==0x054a) {i8751_return=~(0x4a); coin=0; snd=0;} /* Captain Silver ID */
  338.     if ((i8751_value>>8)==0x01) i8751_return=0; /* Coinage - Not Supported */
  339.     if ((i8751_value>>8)==0x02) {i8751_return=snd | coin; snd=0; } /* Coin Return */
  340.     if (i8751_value==0x0003 && coin) {i8751_return=0; coin--;} /* Coin Clear */
  341. }
  342.  
  343. static WRITE_HANDLER( garyoret_i8751_w )
  344. {
  345.     static int coin1,coin2,latch;
  346.     i8751_return=0;
  347.  
  348.     switch (offset) {
  349.     case 0: /* High byte */
  350.         i8751_value=(i8751_value&0xff) | (data<<8);
  351.         break;
  352.     case 1: /* Low byte */
  353.         i8751_value=(i8751_value&0xff00) | data;
  354.         break;
  355.     }
  356.  
  357.     /* Coins are controlled by the i8751 */
  358.      if ((readinputport(2)&3)==3) latch=1;
  359.      if ((readinputport(2)&1)!=1 && latch) {coin1++; latch=0;}
  360.      if ((readinputport(2)&2)!=2 && latch) {coin2++; latch=0;}
  361.  
  362.     /* Work out return values */
  363.     if ((i8751_value>>8)==0x00) {i8751_return=0; coin1=coin2=0;}
  364.     if ((i8751_value>>8)==0x01)  i8751_return=0x59a; /* ID */
  365.     if ((i8751_value>>8)==0x04)  i8751_return=i8751_value; /* Coinage settings (Not supported) */
  366.     if ((i8751_value>>8)==0x05) {i8751_return=0x00 | ((coin1 / 10) << 4) | (coin1 % 10);  } /* Coin 1 */
  367.     if ((i8751_value>>8)==0x06 && coin1 && !offset) {i8751_return=0x600; coin1--; } /* Coin 1 clear */
  368. }
  369.  
  370. /******************************************************************************/
  371.  
  372. static WRITE_HANDLER( dec8_bank_w )
  373. {
  374.      int bankaddress;
  375.     unsigned char *RAM = memory_region(REGION_CPU1);
  376.  
  377.     bankaddress = 0x10000 + (data & 0x0f) * 0x4000;
  378.     cpu_setbank(1,&RAM[bankaddress]);
  379. }
  380.  
  381. /* Used by Ghostbusters, Meikyuu Hunter G & Gondomania */
  382. static WRITE_HANDLER( ghostb_bank_w )
  383. {
  384.      int bankaddress;
  385.     unsigned char *RAM = memory_region(REGION_CPU1);
  386.  
  387.     /* Bit 0: Interrupt enable/disable (I think..)
  388.        Bit 1: NMI enable/disable
  389.        Bit 2: ??
  390.        Bit 3: Screen flip
  391.        Bits 4-7: Bank switch
  392.     */
  393.  
  394.     bankaddress = 0x10000 + (data >> 4) * 0x4000;
  395.     cpu_setbank(1,&RAM[bankaddress]);
  396.  
  397.     if (data&1) int_enable=1; else int_enable=0;
  398.     if (data&2) nmi_enable=1; else nmi_enable=0;
  399.     if (data&8) dec8_flipscreen_w(0,1); else dec8_flipscreen_w(0,0);
  400. }
  401.  
  402. WRITE_HANDLER( csilver_control_w )
  403. {
  404.     int bankaddress;
  405.     unsigned char *RAM = memory_region(REGION_CPU1);
  406.  
  407.     /* Bottom 4 bits - bank switch */
  408.     bankaddress = 0x10000 + (data & 0x0f) * 0x4000;
  409.     cpu_setbank(1,&RAM[bankaddress]);
  410.  
  411.     /* There are unknown bits in the top half of the byte! */
  412.  //logerror("PC %06x - Write %02x to %04x\n",cpu_get_pc(),data,offset+0x1802);
  413. }
  414.  
  415. static WRITE_HANDLER( dec8_sound_w )
  416. {
  417.      soundlatch_w(0,data);
  418.     cpu_cause_interrupt(1,M6502_INT_NMI);
  419. }
  420.  
  421. static WRITE_HANDLER( oscar_sound_w )
  422. {
  423.      soundlatch_w(0,data);
  424.     cpu_cause_interrupt(2,M6502_INT_NMI);
  425. }
  426.  
  427. static void csilver_adpcm_int(int data)
  428. {
  429.     static int toggle =0;
  430.  
  431.     toggle ^= 1;
  432.     if (toggle)
  433.         cpu_cause_interrupt(2,M6502_INT_IRQ);
  434.  
  435.     MSM5205_data_w (0,msm5205next>>4);
  436.     msm5205next<<=4;
  437. }
  438.  
  439. static READ_HANDLER( csilver_adpcm_reset_r )
  440. {
  441.     MSM5205_reset_w(0,0);
  442.     return 0;
  443. }
  444.  
  445. static WRITE_HANDLER( csilver_adpcm_data_w )
  446. {
  447.     msm5205next = data;
  448. }
  449.  
  450. static WRITE_HANDLER( csilver_sound_bank_w )
  451. {
  452.     unsigned char *RAM = memory_region(REGION_CPU3);
  453.  
  454.     if (data&8) { cpu_setbank(3,&RAM[0x14000]); }
  455.     else { cpu_setbank(3,&RAM[0x10000]); }
  456. }
  457.  
  458. /******************************************************************************/
  459.  
  460. static WRITE_HANDLER( oscar_int_w )
  461. {
  462.     /* Deal with interrupts, coins also generate NMI to CPU 0 */
  463.     switch (offset) {
  464.         case 0: /* IRQ2 */
  465.             cpu_cause_interrupt (1, M6809_INT_IRQ);
  466.             return;
  467.         case 1: /* IRC 1 */
  468.             return;
  469.         case 2: /* IRQ 1 */
  470.             cpu_cause_interrupt (0, M6809_INT_IRQ);
  471.             return;
  472.         case 3: /* IRC 2 */
  473.             return;
  474.     }
  475. }
  476.  
  477. /* Used by Shackled, Last Mission, Captain Silver */
  478. static WRITE_HANDLER( shackled_int_w )
  479. {
  480.     switch (offset) {
  481.         case 0: /* CPU 2 - IRQ acknowledge */
  482.             return;
  483.         case 1: /* CPU 1 - IRQ acknowledge */
  484.             return;
  485.         case 2: /* i8751 - FIRQ acknowledge */
  486.             return;
  487.         case 3: /* IRQ 1 */
  488.             cpu_cause_interrupt (0, M6809_INT_IRQ);
  489.             return;
  490.         case 4: /* IRQ 2 */
  491.             cpu_cause_interrupt (1, M6809_INT_IRQ);
  492.             return;
  493.     }
  494. }
  495.  
  496. /******************************************************************************/
  497.  
  498. static READ_HANDLER( dec8_share_r ) { return dec8_shared_ram[offset]; }
  499. static READ_HANDLER( dec8_share2_r ) { return dec8_shared2_ram[offset]; }
  500. static WRITE_HANDLER( dec8_share_w ) { dec8_shared_ram[offset]=data; }
  501. static WRITE_HANDLER( dec8_share2_w ) { dec8_shared2_ram[offset]=data; }
  502. static READ_HANDLER( shackled_sprite_r ) { return spriteram[offset]; }
  503. static WRITE_HANDLER( shackled_sprite_w ) { spriteram[offset]=data; }
  504.  
  505. /******************************************************************************/
  506.  
  507. static struct MemoryReadAddress cobra_readmem[] =
  508. {
  509.     { 0x0000, 0x07ff, MRA_RAM },
  510.     { 0x0800, 0x0fff, dec8_pf0_data_r },
  511.     { 0x1000, 0x17ff, dec8_pf1_data_r },
  512.     { 0x1800, 0x2fff, MRA_RAM },
  513.     { 0x3000, 0x31ff, paletteram_r },
  514.     { 0x3800, 0x3800, input_port_0_r }, /* Player 1 */
  515.     { 0x3801, 0x3801, input_port_1_r }, /* Player 2 */
  516.     { 0x3802, 0x3802, input_port_3_r }, /* Dip 1 */
  517.     { 0x3803, 0x3803, input_port_4_r }, /* Dip 2 */
  518.     { 0x3a00, 0x3a00, input_port_2_r }, /* VBL & coins */
  519.     { 0x4000, 0x7fff, MRA_BANK1 },
  520.     { 0x8000, 0xffff, MRA_ROM },
  521.     { -1 }  /* end of table */
  522. };
  523.  
  524. static struct MemoryWriteAddress cobra_writemem[] =
  525. {
  526.     { 0x0000, 0x07ff, MWA_RAM },
  527.     { 0x0800, 0x0fff, dec8_pf0_data_w, &dec8_pf0_data },
  528.     { 0x1000, 0x17ff, dec8_pf1_data_w, &dec8_pf1_data },
  529.     { 0x1800, 0x1fff, MWA_RAM },
  530.     { 0x2000, 0x27ff, dec8_videoram_w, &videoram, &videoram_size },
  531.     { 0x2800, 0x2fff, MWA_RAM, &spriteram, &spriteram_size },
  532.     { 0x3000, 0x31ff, paletteram_xxxxBBBBGGGGRRRR_swap_w, &paletteram },
  533.     { 0x3200, 0x37ff, MWA_RAM }, /* Unused */
  534.     { 0x3800, 0x381f, dec8_bac06_0_w },
  535.     { 0x3a00, 0x3a1f, dec8_bac06_1_w },
  536.     { 0x3c00, 0x3c00, dec8_bank_w },
  537.     { 0x3c02, 0x3c02, buffer_spriteram_w }, /* DMA */
  538.     { 0x3e00, 0x3e00, dec8_sound_w },
  539.     { 0x4000, 0xffff, MWA_ROM },
  540.     { -1 }  /* end of table */
  541. };
  542.  
  543. static struct MemoryReadAddress ghostb_readmem[] =
  544. {
  545.     { 0x0000, 0x1fff, MRA_RAM },
  546.     { 0x1800, 0x1fff, videoram_r },
  547.     { 0x2000, 0x27ff, dec8_pf0_data_r },
  548.     { 0x2800, 0x2dff, MRA_RAM },
  549.     { 0x3000, 0x37ff, MRA_RAM },
  550.     { 0x3800, 0x3800, input_port_0_r }, /* Player 1 */
  551.     { 0x3801, 0x3801, input_port_1_r }, /* Player 2 */
  552.     { 0x3802, 0x3802, input_port_2_r }, /* Player 3 */
  553.     { 0x3803, 0x3803, input_port_3_r }, /* Start buttons + VBL */
  554.     { 0x3820, 0x3820, input_port_5_r }, /* Dip */
  555.     { 0x3840, 0x3840, i8751_h_r },
  556.     { 0x3860, 0x3860, i8751_l_r },
  557.     { 0x4000, 0x7fff, MRA_BANK1 },
  558.     { 0x8000, 0xffff, MRA_ROM },
  559.     { -1 }  /* end of table */
  560. };
  561.  
  562. static struct MemoryWriteAddress ghostb_writemem[] =
  563. {
  564.     { 0x0000, 0x0fff, MWA_RAM },
  565.     { 0x1000, 0x17ff, MWA_RAM },
  566.     { 0x1800, 0x1fff, dec8_videoram_w, &videoram, &videoram_size },
  567.     { 0x2000, 0x27ff, dec8_pf0_data_w, &dec8_pf0_data },
  568.     { 0x2800, 0x2bff, MWA_RAM }, /* Scratch ram for rowscroll? */
  569.     { 0x2c00, 0x2dff, MWA_RAM, &dec8_row },
  570.     { 0x2e00, 0x2fff, MWA_RAM }, /* Unused */
  571.     { 0x3000, 0x37ff, MWA_RAM, &spriteram, &spriteram_size },
  572.     { 0x3800, 0x3800, dec8_sound_w },
  573.     { 0x3820, 0x383f, dec8_bac06_0_w },
  574.     { 0x3840, 0x3840, ghostb_bank_w },
  575.     { 0x3860, 0x3861, ghostb_i8751_w },
  576.     { 0x4000, 0xffff, MWA_ROM },
  577.     { -1 }  /* end of table */
  578. };
  579.  
  580. static struct MemoryReadAddress srdarwin_readmem[] =
  581. {
  582.     { 0x0000, 0x13ff, MRA_RAM },
  583.     { 0x1400, 0x17ff, dec8_pf0_data_r },
  584.     { 0x2000, 0x2000, i8751_h_r },
  585.     { 0x2001, 0x2001, i8751_l_r },
  586.     { 0x3800, 0x3800, input_port_2_r }, /* Dip 1 */
  587.     { 0x3801, 0x3801, input_port_0_r }, /* Player 1 */
  588.     { 0x3802, 0x3802, input_port_1_r }, /* Player 2 (cocktail) + VBL */
  589.     { 0x3803, 0x3803, input_port_3_r }, /* Dip 2 */
  590.     { 0x4000, 0x7fff, MRA_BANK1 },
  591.     { 0x8000, 0xffff, MRA_ROM },
  592.     { -1 }  /* end of table */
  593. };
  594.  
  595. static struct MemoryWriteAddress srdarwin_writemem[] =
  596. {
  597.     { 0x0000, 0x05ff, MWA_RAM },
  598.     { 0x0600, 0x07ff, MWA_RAM, &spriteram },
  599.     { 0x0800, 0x0fff, srdarwin_videoram_w, &videoram, &spriteram_size },
  600.     { 0x1000, 0x13ff, MWA_RAM },
  601.     { 0x1400, 0x17ff, dec8_pf0_data_w, &dec8_pf0_data },
  602.     { 0x1800, 0x1801, srdarwin_i8751_w },
  603.     { 0x1802, 0x1802, i8751_reset_w },        /* Maybe.. */
  604.     { 0x1803, 0x1803, MWA_NOP },            /* NMI ack */
  605.     { 0x1804, 0x1804, buffer_spriteram_w }, /* DMA */
  606.     { 0x1805, 0x1806, srdarwin_control_w }, /* Scroll & Bank */
  607.     { 0x2000, 0x2000, dec8_sound_w },       /* Sound */
  608.     { 0x2001, 0x2001, dec8_flipscreen_w },  /* Flipscreen */
  609.     { 0x2800, 0x288f, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  610.     { 0x3000, 0x308f, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  611.     { 0x4000, 0xffff, MWA_ROM },
  612.     { -1 }  /* end of table */
  613. };
  614.  
  615. static struct MemoryReadAddress gondo_readmem[] =
  616. {
  617.     { 0x0000, 0x17ff, MRA_RAM },
  618.     { 0x1800, 0x1fff, videoram_r },
  619.     { 0x2000, 0x27ff, dec8_pf0_data_r },
  620.     { 0x2800, 0x2bff, paletteram_r },
  621.     { 0x2c00, 0x2fff, paletteram_2_r },
  622.     { 0x3000, 0x37ff, MRA_RAM },          /* Sprites */
  623.     { 0x3800, 0x3800, input_port_7_r },   /* Dip 1 */
  624.     { 0x3801, 0x3801, input_port_8_r },   /* Dip 2 */
  625.     { 0x380a, 0x380b, gondo_player_1_r }, /* Player 1 rotary */
  626.     { 0x380c, 0x380d, gondo_player_2_r }, /* Player 2 rotary */
  627.     { 0x380e, 0x380e, input_port_3_r },   /* VBL */
  628.     { 0x380f, 0x380f, input_port_2_r },   /* Fire buttons */
  629.     { 0x3838, 0x3838, i8751_h_r },
  630.     { 0x3839, 0x3839, i8751_l_r },
  631.     { 0x4000, 0x7fff, MRA_BANK1 },
  632.     { 0x8000, 0xffff, MRA_ROM },
  633.     { -1 }  /* end of table */
  634. };
  635.  
  636. static struct MemoryWriteAddress gondo_writemem[] =
  637. {
  638.     { 0x0000, 0x17ff, MWA_RAM },
  639.     { 0x1800, 0x1fff, dec8_videoram_w, &videoram, &videoram_size },
  640.     { 0x2000, 0x27ff, dec8_pf0_data_w, &dec8_pf0_data },
  641.     { 0x2800, 0x2bff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  642.     { 0x2c00, 0x2fff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  643.     { 0x3000, 0x37ff, MWA_RAM, &spriteram, &spriteram_size },
  644.     { 0x3810, 0x3810, dec8_sound_w },
  645.     { 0x3818, 0x382f, gondo_scroll_w },
  646.     { 0x3830, 0x3830, ghostb_bank_w }, /* Bank + NMI enable */
  647.     { 0x383a, 0x383b, gondo_i8751_w },
  648.     { 0x4000, 0xffff, MWA_ROM },
  649.     { -1 }  /* end of table */
  650. };
  651.  
  652. static struct MemoryReadAddress oscar_readmem[] =
  653. {
  654.     { 0x0000, 0x0eff, dec8_share_r },
  655.     { 0x0f00, 0x0fff, MRA_RAM },
  656.     { 0x1000, 0x1fff, dec8_share2_r },
  657.     { 0x2000, 0x27ff, videoram_r },
  658.     { 0x2800, 0x2fff, dec8_pf0_data_r },
  659.     { 0x3000, 0x37ff, MRA_RAM }, /* Sprites */
  660.     { 0x3800, 0x3bff, paletteram_r },
  661.     { 0x3c00, 0x3c00, input_port_0_r },
  662.     { 0x3c01, 0x3c01, input_port_1_r },
  663.     { 0x3c02, 0x3c02, input_port_2_r }, /* VBL & coins */
  664.     { 0x3c03, 0x3c03, input_port_3_r }, /* Dip 1 */
  665.     { 0x3c04, 0x3c04, input_port_4_r },
  666.     { 0x4000, 0x7fff, MRA_BANK1 },
  667.     { 0x8000, 0xffff, MRA_ROM },
  668.     { -1 }  /* end of table */
  669. };
  670.  
  671. static struct MemoryWriteAddress oscar_writemem[] =
  672. {
  673.     { 0x0000, 0x0eff, dec8_share_w, &dec8_shared_ram },
  674.     { 0x0f00, 0x0fff, MWA_RAM },
  675.     { 0x1000, 0x1fff, dec8_share2_w, &dec8_shared2_ram },
  676.     { 0x2000, 0x27ff, dec8_videoram_w, &videoram, &videoram_size },
  677.     { 0x2800, 0x2fff, dec8_pf0_data_w, &dec8_pf0_data },
  678.     { 0x3000, 0x37ff, MWA_RAM, &spriteram, &spriteram_size },
  679.     { 0x3800, 0x3bff, paletteram_xxxxBBBBGGGGRRRR_swap_w, &paletteram },
  680.     { 0x3c00, 0x3c1f, dec8_bac06_0_w },
  681.     { 0x3c80, 0x3c80, buffer_spriteram_w },    /* DMA */
  682.     { 0x3d00, 0x3d00, dec8_bank_w },           /* BNKS */
  683.     { 0x3d80, 0x3d80, oscar_sound_w },         /* SOUN */
  684.     { 0x3e00, 0x3e00, MWA_NOP },               /* COINCL */
  685.     { 0x3e80, 0x3e83, oscar_int_w },
  686.     { 0x4000, 0xffff, MWA_ROM },
  687.     { -1 }  /* end of table */
  688. };
  689.  
  690. static struct MemoryReadAddress oscar_sub_readmem[] =
  691. {
  692.     { 0x0000, 0x0eff, dec8_share_r },
  693.     { 0x0f00, 0x0fff, MRA_RAM },
  694.     { 0x1000, 0x1fff, dec8_share2_r },
  695.     { 0x4000, 0xffff, MRA_ROM },
  696.     { -1 }  /* end of table */
  697. };
  698.  
  699. static struct MemoryWriteAddress oscar_sub_writemem[] =
  700. {
  701.     { 0x0000, 0x0eff, dec8_share_w },
  702.     { 0x0f00, 0x0fff, MWA_RAM },
  703.     { 0x1000, 0x1fff, dec8_share2_w },
  704.     { 0x3e80, 0x3e83, oscar_int_w },
  705.     { 0x4000, 0xffff, MWA_ROM },
  706.     { -1 }  /* end of table */
  707. };
  708.  
  709. static struct MemoryReadAddress lastmiss_readmem[] =
  710. {
  711.     { 0x0000, 0x0fff, dec8_share_r },
  712.     { 0x1000, 0x13ff, paletteram_r },
  713.     { 0x1400, 0x17ff, paletteram_2_r },
  714.     { 0x1800, 0x1800, input_port_0_r },
  715.     { 0x1801, 0x1801, input_port_1_r },
  716.     { 0x1802, 0x1802, input_port_2_r },
  717.     { 0x1803, 0x1803, input_port_3_r }, /* Dip 1 */
  718.     { 0x1804, 0x1804, input_port_4_r }, /* Dip 2 */
  719.     { 0x1806, 0x1806, i8751_h_r },
  720.     { 0x1807, 0x1807, i8751_l_r },
  721.     { 0x2000, 0x27ff, videoram_r },
  722.     { 0x2800, 0x2fff, MRA_RAM },
  723.     { 0x3000, 0x37ff, dec8_share2_r },
  724.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  725.     { 0x4000, 0x7fff, MRA_BANK1 },
  726.     { 0x8000, 0xffff, MRA_ROM },
  727.     { -1 }  /* end of table */
  728. };
  729.  
  730. static struct MemoryWriteAddress lastmiss_writemem[] =
  731. {
  732.     { 0x0000, 0x0fff, dec8_share_w, &dec8_shared_ram },
  733.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  734.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  735.     { 0x1800, 0x1804, shackled_int_w },
  736.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  737.     { 0x1807, 0x1807, dec8_flipscreen_w },
  738.     { 0x1809, 0x1809, lastmiss_scrollx_w }, /* Scroll LSB */
  739.     { 0x180b, 0x180b, lastmiss_scrolly_w }, /* Scroll LSB */
  740.     { 0x180c, 0x180c, oscar_sound_w },
  741.     { 0x180d, 0x180d, lastmiss_control_w }, /* Bank switch + Scroll MSB */
  742.     { 0x180e, 0x180f, lastmiss_i8751_w },
  743.     { 0x2000, 0x27ff, dec8_videoram_w, &videoram, &videoram_size },
  744.     { 0x2800, 0x2fff, MWA_RAM, &spriteram, &spriteram_size },
  745.     { 0x3000, 0x37ff, dec8_share2_w, &dec8_shared2_ram },
  746.     { 0x3800, 0x3fff, dec8_pf0_data_w, &dec8_pf0_data },
  747.     { 0x4000, 0xffff, MWA_ROM },
  748.     { -1 }  /* end of table */
  749. };
  750.  
  751. static struct MemoryReadAddress lastmiss_sub_readmem[] =
  752. {
  753.     { 0x0000, 0x0fff, dec8_share_r },
  754.     { 0x1000, 0x13ff, paletteram_r },
  755.     { 0x1400, 0x17ff, paletteram_2_r },
  756.     { 0x1800, 0x1800, input_port_0_r },
  757.     { 0x1801, 0x1801, input_port_1_r },
  758.     { 0x1802, 0x1802, input_port_2_r },
  759.     { 0x1803, 0x1803, input_port_3_r }, /* Dip 1 */
  760.     { 0x1804, 0x1804, input_port_4_r }, /* Dip 2 */
  761.     { 0x2000, 0x27ff, videoram_r },
  762.     { 0x3000, 0x37ff, dec8_share2_r },
  763.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  764.     { 0x4000, 0xffff, MRA_ROM },
  765.     { -1 }  /* end of table */
  766. };
  767.  
  768. static struct MemoryWriteAddress lastmiss_sub_writemem[] =
  769. {
  770.     { 0x0000, 0x0fff, dec8_share_w },
  771.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w },
  772.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w },
  773.     { 0x1800, 0x1804, shackled_int_w },
  774.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  775.     { 0x1807, 0x1807, dec8_flipscreen_w },
  776.     { 0x180c, 0x180c, oscar_sound_w },
  777.     { 0x2000, 0x27ff, dec8_videoram_w },
  778.     { 0x2800, 0x2fff, shackled_sprite_w },
  779.     { 0x3000, 0x37ff, dec8_share2_w },
  780.     { 0x3800, 0x3fff, dec8_pf0_data_w },
  781.     { 0x4000, 0xffff, MWA_ROM },
  782.     { -1 }  /* end of table */
  783. };
  784.  
  785. static struct MemoryReadAddress shackled_readmem[] =
  786. {
  787.     { 0x0000, 0x0fff, dec8_share_r },
  788.     { 0x1000, 0x13ff, paletteram_r },
  789.     { 0x1400, 0x17ff, paletteram_2_r },
  790.     { 0x1800, 0x1800, input_port_0_r },
  791.     { 0x1801, 0x1801, input_port_1_r },
  792.     { 0x1802, 0x1802, input_port_2_r },
  793.     { 0x1803, 0x1803, input_port_3_r },
  794.     { 0x1804, 0x1804, input_port_4_r },
  795.     { 0x2000, 0x27ff, videoram_r },
  796.     { 0x2800, 0x2fff, shackled_sprite_r },
  797.     { 0x3000, 0x37ff, dec8_share2_r },
  798.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  799.     { 0x4000, 0x7fff, MRA_BANK1 },
  800.     { 0x8000, 0xffff, MRA_ROM },
  801.     { -1 }  /* end of table */
  802. };
  803.  
  804. static struct MemoryWriteAddress shackled_writemem[] =
  805. {
  806.     { 0x0000, 0x0fff, dec8_share_w, &dec8_shared_ram },
  807.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  808.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  809.     { 0x1800, 0x1804, shackled_int_w },
  810.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  811.     { 0x1807, 0x1807, dec8_flipscreen_w },
  812.     { 0x1809, 0x1809, lastmiss_scrollx_w }, /* Scroll LSB */
  813.     { 0x180b, 0x180b, lastmiss_scrolly_w }, /* Scroll LSB */
  814.     { 0x180c, 0x180c, oscar_sound_w },
  815.     { 0x180d, 0x180d, lastmiss_control_w }, /* Bank switch + Scroll MSB */
  816.     { 0x2000, 0x27ff, dec8_videoram_w },
  817.     { 0x2800, 0x2fff, shackled_sprite_w },
  818.     { 0x3000, 0x37ff, dec8_share2_w, &dec8_shared2_ram },
  819.     { 0x3800, 0x3fff, dec8_pf0_data_w, &dec8_pf0_data },
  820.     { 0x4000, 0xffff, MWA_ROM },
  821.     { -1 }  /* end of table */
  822. };
  823.  
  824. static struct MemoryReadAddress shackled_sub_readmem[] =
  825. {
  826.     { 0x0000, 0x0fff, dec8_share_r },
  827.     { 0x1000, 0x13ff, paletteram_r },
  828.     { 0x1400, 0x17ff, paletteram_2_r },
  829.     { 0x1800, 0x1800, input_port_0_r },
  830.     { 0x1801, 0x1801, input_port_1_r },
  831.     { 0x1802, 0x1802, input_port_2_r },
  832.     { 0x1803, 0x1803, input_port_3_r },
  833.     { 0x1804, 0x1804, input_port_4_r },
  834.     { 0x1806, 0x1806, i8751_h_r },
  835.     { 0x1807, 0x1807, i8751_l_r },
  836.     { 0x2000, 0x27ff, videoram_r },
  837.     { 0x2800, 0x2fff, MRA_RAM },
  838.     { 0x3000, 0x37ff, dec8_share2_r },
  839.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  840.     { 0x4000, 0xffff, MRA_ROM },
  841.     { -1 }  /* end of table */
  842. };
  843.  
  844. static struct MemoryWriteAddress shackled_sub_writemem[] =
  845. {
  846.     { 0x0000, 0x0fff, dec8_share_w },
  847.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w },
  848.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w },
  849.     { 0x1800, 0x1804, shackled_int_w },
  850.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  851.     { 0x1807, 0x1807, dec8_flipscreen_w },
  852.     { 0x1809, 0x1809, lastmiss_scrollx_w }, /* Scroll LSB */
  853.     { 0x180b, 0x180b, lastmiss_scrolly_w }, /* Scroll LSB */
  854.     { 0x180c, 0x180c, oscar_sound_w },
  855.     { 0x180d, 0x180d, lastmiss_control_w }, /* Bank switch + Scroll MSB */
  856.     { 0x180e, 0x180f, shackled_i8751_w },
  857.     { 0x2000, 0x27ff, dec8_videoram_w, &videoram, &videoram_size },
  858.     { 0x2800, 0x2fff, MWA_RAM, &spriteram, &spriteram_size },
  859.     { 0x3000, 0x37ff, dec8_share2_w },
  860.     { 0x3800, 0x3fff, dec8_pf0_data_w },
  861.     { 0x4000, 0xffff, MWA_ROM },
  862.     { -1 }  /* end of table */
  863. };
  864.  
  865. static struct MemoryReadAddress csilver_readmem[] =
  866. {
  867.     { 0x0000, 0x0fff, dec8_share_r },
  868.     { 0x1000, 0x13ff, paletteram_r },
  869.     { 0x1400, 0x17ff, paletteram_2_r },
  870.     { 0x1800, 0x1800, input_port_1_r },
  871.     { 0x1801, 0x1801, input_port_0_r },
  872.     { 0x1803, 0x1803, input_port_2_r },
  873.     { 0x1804, 0x1804, input_port_4_r }, /* Dip 2 */
  874.     { 0x1805, 0x1805, input_port_3_r }, /* Dip 1 */
  875.     { 0x1c00, 0x1c00, i8751_h_r },
  876.     { 0x1e00, 0x1e00, i8751_l_r },
  877.     { 0x2000, 0x27ff, videoram_r },
  878.     { 0x2800, 0x2fff, shackled_sprite_r },
  879.     { 0x3000, 0x37ff, dec8_share2_r },
  880.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  881.     { 0x4000, 0x7fff, MRA_BANK1 },
  882.     { 0x8000, 0xffff, MRA_ROM },
  883.     { -1 }  /* end of table */
  884. };
  885.  
  886. static struct MemoryWriteAddress csilver_writemem[] =
  887. {
  888.     { 0x0000, 0x0fff, dec8_share_w, &dec8_shared_ram },
  889.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  890.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  891.     { 0x1800, 0x1804, shackled_int_w },
  892.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  893.     { 0x1807, 0x1807, dec8_flipscreen_w },
  894.     { 0x1808, 0x180b, dec8_scroll2_w },
  895.     { 0x180c, 0x180c, oscar_sound_w },
  896.     { 0x180d, 0x180d, csilver_control_w },
  897.     { 0x180e, 0x180f, csilver_i8751_w },
  898.     { 0x2000, 0x27ff, dec8_videoram_w },
  899.     { 0x2800, 0x2fff, shackled_sprite_w },
  900.     { 0x3000, 0x37ff, dec8_share2_w, &dec8_shared2_ram },
  901.     { 0x3800, 0x3fff, dec8_pf0_data_w, &dec8_pf0_data },
  902.     { 0x4000, 0xffff, MWA_ROM },
  903.     { -1 }  /* end of table */
  904. };
  905.  
  906. static struct MemoryReadAddress csilver_sub_readmem[] =
  907. {
  908.     { 0x0000, 0x0fff, dec8_share_r },
  909.     { 0x1000, 0x13ff, paletteram_r },
  910.     { 0x1400, 0x17ff, paletteram_2_r },
  911. //    { 0x1800, 0x1800, input_port_0_r },
  912. //    { 0x1801, 0x1801, input_port_1_r },
  913.     { 0x1803, 0x1803, input_port_2_r },
  914.     { 0x1804, 0x1804, input_port_4_r },
  915.     { 0x1805, 0x1805, input_port_3_r },
  916.     { 0x2000, 0x27ff, videoram_r },
  917.     { 0x2800, 0x2fff, MRA_RAM },
  918.     { 0x3000, 0x37ff, dec8_share2_r },
  919.     { 0x3800, 0x3fff, dec8_pf0_data_r },
  920.     { 0x4000, 0xffff, MRA_ROM },
  921.     { -1 }  /* end of table */
  922. };
  923.  
  924. static struct MemoryWriteAddress csilver_sub_writemem[] =
  925. {
  926.     { 0x0000, 0x0fff, dec8_share_w },
  927.     { 0x1000, 0x13ff, paletteram_xxxxBBBBGGGGRRRR_split1_w },
  928.     { 0x1400, 0x17ff, paletteram_xxxxBBBBGGGGRRRR_split2_w },
  929.     { 0x1800, 0x1804, shackled_int_w },
  930.     { 0x1805, 0x1805, buffer_spriteram_w }, /* DMA */
  931.     { 0x180c, 0x180c, oscar_sound_w },
  932.     { 0x180d, 0x180d, lastmiss_control_w }, /* Bank switch + Scroll MSB */
  933.     { 0x2000, 0x27ff, dec8_videoram_w, &videoram, &videoram_size },
  934.     { 0x2800, 0x2fff, MWA_RAM, &spriteram, &spriteram_size },
  935.     { 0x3000, 0x37ff, dec8_share2_w },
  936.     { 0x3800, 0x3fff, dec8_pf0_data_w },
  937.     { 0x4000, 0xffff, MWA_ROM },
  938.     { -1 }  /* end of table */
  939. };
  940.  
  941. static struct MemoryReadAddress garyoret_readmem[] =
  942. {
  943.     { 0x0000, 0x17ff, MRA_RAM },
  944.     { 0x1800, 0x1fff, videoram_r },
  945.     { 0x2000, 0x27ff, dec8_pf0_data_r },
  946.     { 0x2800, 0x2bff, paletteram_r },
  947.     { 0x2c00, 0x2fff, paletteram_2_r },
  948.     { 0x3000, 0x37ff, MRA_RAM },          /* Sprites */
  949.     { 0x3800, 0x3800, input_port_3_r },   /* Dip 1 */
  950.     { 0x3801, 0x3801, input_port_4_r },   /* Dip 2 */
  951.     { 0x3808, 0x3808, MRA_NOP },          /* ? */
  952.     { 0x380a, 0x380a, input_port_1_r },   /* Player 2 + VBL */
  953.     { 0x380b, 0x380b, input_port_0_r },   /* Player 1 */
  954.     { 0x383a, 0x383a, i8751_h_r },
  955.     { 0x383b, 0x383b, i8751_l_r },
  956.     { 0x4000, 0x7fff, MRA_BANK1 },
  957.     { 0x8000, 0xffff, MRA_ROM },
  958.     { -1 }  /* end of table */
  959. };
  960.  
  961. static struct MemoryWriteAddress garyoret_writemem[] =
  962. {
  963.     { 0x0000, 0x17ff, MWA_RAM },
  964.     { 0x1800, 0x1fff, dec8_videoram_w, &videoram, &videoram_size },
  965.     { 0x2000, 0x27ff, dec8_pf0_data_w, &dec8_pf0_data },
  966.     { 0x2800, 0x2bff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  967.     { 0x2c00, 0x2fff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  968.     { 0x3000, 0x37ff, MWA_RAM, &spriteram, &spriteram_size },
  969.     { 0x3810, 0x3810, dec8_sound_w },
  970.     { 0x3818, 0x382f, gondo_scroll_w },
  971.     { 0x3830, 0x3830, ghostb_bank_w }, /* Bank + NMI enable */
  972.     { 0x3838, 0x3839, garyoret_i8751_w },
  973.     { 0x4000, 0xffff, MWA_ROM },
  974.     { -1 }  /* end of table */
  975. };
  976.  
  977. /******************************************************************************/
  978.  
  979. /* Used for Cobra Command, Maze Hunter, Super Real Darwin, Gondomania, etc */
  980. static struct MemoryReadAddress dec8_s_readmem[] =
  981. {
  982.     { 0x0000, 0x05ff, MRA_RAM},
  983.     { 0x6000, 0x6000, soundlatch_r },
  984.     { 0x8000, 0xffff, MRA_ROM },
  985.     { -1 }  /* end of table */
  986. };
  987.  
  988. static struct MemoryWriteAddress dec8_s_writemem[] =
  989. {
  990.     { 0x0000, 0x05ff, MWA_RAM},
  991.     { 0x2000, 0x2000, YM2203_control_port_0_w }, /* OPN */
  992.     { 0x2001, 0x2001, YM2203_write_port_0_w },
  993.     { 0x4000, 0x4000, YM3812_control_port_0_w }, /* OPL */
  994.     { 0x4001, 0x4001, YM3812_write_port_0_w },
  995.     { 0x8000, 0xffff, MWA_ROM },
  996.     { -1 }  /* end of table */
  997. };
  998.  
  999. /* Used by Last Mission, Shackled & Breywood */
  1000. static struct MemoryReadAddress ym3526_s_readmem[] =
  1001. {
  1002.     { 0x0000, 0x05ff, MRA_RAM},
  1003.     { 0x3000, 0x3000, soundlatch_r },
  1004.     { 0x8000, 0xffff, MRA_ROM },
  1005.     { -1 }  /* end of table */
  1006. };
  1007.  
  1008. static struct MemoryWriteAddress ym3526_s_writemem[] =
  1009. {
  1010.     { 0x0000, 0x05ff, MWA_RAM},
  1011.     { 0x0800, 0x0800, YM2203_control_port_0_w }, /* OPN */
  1012.     { 0x0801, 0x0801, YM2203_write_port_0_w },
  1013.     { 0x1000, 0x1000, YM3526_control_port_0_w }, /* OPL? */
  1014.     { 0x1001, 0x1001, YM3526_write_port_0_w },
  1015.     { 0x8000, 0xffff, MWA_ROM },
  1016.     { -1 }  /* end of table */
  1017. };
  1018.  
  1019. /* Captain Silver - same sound system as Pocket Gal */
  1020. static struct MemoryReadAddress csilver_s_readmem[] =
  1021. {
  1022.     { 0x0000, 0x07ff, MRA_RAM },
  1023.     { 0x3000, 0x3000, soundlatch_r },
  1024.     { 0x3400, 0x3400, csilver_adpcm_reset_r },    /* ? not sure */
  1025.     { 0x4000, 0x7fff, MRA_BANK3 },
  1026.     { 0x8000, 0xffff, MRA_ROM },
  1027.     { -1 }    /* end of table */
  1028. };
  1029.  
  1030. static struct MemoryWriteAddress csilver_s_writemem[] =
  1031. {
  1032.     { 0x0000, 0x07ff, MWA_RAM },
  1033.     { 0x0800, 0x0800, YM2203_control_port_0_w },
  1034.     { 0x0801, 0x0801, YM2203_write_port_0_w },
  1035.     { 0x1000, 0x1000, YM3812_control_port_0_w },
  1036.     { 0x1001, 0x1001, YM3812_write_port_0_w },
  1037.     { 0x1800, 0x1800, csilver_adpcm_data_w },    /* ADPCM data for the MSM5205 chip */
  1038.     { 0x2000, 0x2000, csilver_sound_bank_w },
  1039.     { 0x4000, 0xffff, MWA_ROM },
  1040.     { -1 }    /* end of table */
  1041. };
  1042.  
  1043. /******************************************************************************/
  1044.  
  1045. #define PLAYER1_JOYSTICK /* Player 1 controls */ \
  1046.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY ) \
  1047.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY ) \
  1048.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY ) \
  1049.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1050.  
  1051. #define PLAYER2_JOYSTICK /* Player 2 controls */ \
  1052.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL ) \
  1053.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL ) \
  1054.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL ) \
  1055.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1056.  
  1057. INPUT_PORTS_START( cobracom )
  1058.     PORT_START /* Player 1 controls */
  1059.     PLAYER1_JOYSTICK
  1060.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1061.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1062.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1063.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  1064.  
  1065.     PORT_START    /* Player 2 controls */
  1066.     PLAYER2_JOYSTICK
  1067.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1068.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1069.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1070.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  1071.  
  1072.     PORT_START    /* IN1 */
  1073.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1074.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1075.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  1076.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1077.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1078.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1079.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1080.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  1081.  
  1082.     PORT_START    /* Dip switch bank 1 */
  1083.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1084.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1085.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1086.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1087.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1088.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1089.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1090.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1091.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1092.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1093.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1094.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1095.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1096.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1097.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1098.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1099.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1100.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1101.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1102.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  1103.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1104.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1105.  
  1106.     PORT_START    /* Dip switch bank 2 */
  1107.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1108.     PORT_DIPSETTING(    0x03, "3" )
  1109.     PORT_DIPSETTING(    0x02, "4" )
  1110.     PORT_DIPSETTING(    0x01, "5" )
  1111.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1112.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1113.     PORT_DIPSETTING(    0x04, "Easy" )
  1114.     PORT_DIPSETTING(    0x0c, "Normal" )
  1115.     PORT_DIPSETTING(    0x08, "Hard" )
  1116.     PORT_DIPSETTING(    0x00, "Hardest" )
  1117.     PORT_DIPNAME( 0x10, 0x10, "Allow Continue" )
  1118.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  1119.     PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
  1120.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1121.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1122.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1123.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1124.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1125.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1126.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1127.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1128.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1129. INPUT_PORTS_END
  1130.  
  1131. INPUT_PORTS_START( ghostb )
  1132.     PORT_START    /* Player 1 controls */
  1133.     PLAYER1_JOYSTICK
  1134.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1135.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1136.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1137.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1138.  
  1139.     PORT_START    /* Player 2 controls */
  1140.     PLAYER2_JOYSTICK
  1141.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1142.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1143.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1144.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1145.  
  1146.     PORT_START    /* Player 3 controls */
  1147.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER3 )
  1148.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
  1149.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER3 )
  1150.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
  1151.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  1152.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
  1153.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1154.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1155.  
  1156.     PORT_START
  1157.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1158.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1159.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
  1160.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
  1161.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1162.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1163.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1164.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1165.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1166.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1167.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1168.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1169.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1170.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1171.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1172.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1173.  
  1174.     PORT_START    /* Dummy input for i8751 */
  1175.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
  1176.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
  1177.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1178.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1179.  
  1180.     PORT_START    /* Dip switch */
  1181.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1182.     PORT_DIPSETTING(    0x01, "1" )
  1183.     PORT_DIPSETTING(    0x03, "3" )
  1184.     PORT_DIPSETTING(    0x02, "5" )
  1185.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1186.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1187.     PORT_DIPSETTING(    0x04, "Easy" )
  1188.     PORT_DIPSETTING(    0x0c, "Normal" )
  1189.     PORT_DIPSETTING(    0x08, "Hard" )
  1190.     PORT_DIPSETTING(    0x00, "Hardest" )
  1191.     PORT_DIPNAME( 0x30, 0x30, "Scene Time" )
  1192.     PORT_DIPSETTING(    0x00, "4.00" )
  1193.     PORT_DIPSETTING(    0x10, "4.30" )
  1194.     PORT_DIPSETTING(    0x30, "5.00" )
  1195.     PORT_DIPSETTING(    0x20, "6.00" )
  1196.     PORT_DIPNAME( 0x40, 0x00, "Allow Continue" )
  1197.     PORT_DIPSETTING(    0x40, DEF_STR( No ) )
  1198.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  1199.     PORT_DIPNAME( 0x80, 0x80, "Beam Energy Pickup" ) /* Ghostb only */
  1200.     PORT_DIPSETTING(    0x00, "Up 1.5%" )
  1201.     PORT_DIPSETTING(    0x80, "Normal" )
  1202. INPUT_PORTS_END
  1203.  
  1204. INPUT_PORTS_START( meikyuh )
  1205.     PORT_START    /* Player 1 controls */
  1206.     PLAYER1_JOYSTICK
  1207.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1208.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1209.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1210.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1211.  
  1212.     PORT_START    /* Player 2 controls */
  1213.     PLAYER2_JOYSTICK
  1214.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1215.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1216.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1217.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1218.  
  1219.     PORT_START    /* Player 3 controls */
  1220.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER3 )
  1221.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
  1222.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER3 )
  1223.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
  1224.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  1225.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
  1226.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1227.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1228.  
  1229.     PORT_START
  1230.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1231.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1232.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
  1233.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
  1234.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  1235.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1236.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  1237.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1238.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1239.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1240.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1241.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1242.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1243.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1244.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1245.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1246.  
  1247.     PORT_START    /* Dummy input for i8751 */
  1248.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
  1249.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
  1250.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  1251.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  1252.  
  1253.     PORT_START    /* Dip switch */
  1254.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1255.     PORT_DIPSETTING(    0x01, "1" )
  1256.     PORT_DIPSETTING(    0x03, "3" )
  1257.     PORT_DIPSETTING(    0x02, "5" )
  1258.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1259.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1260.     PORT_DIPSETTING(    0x04, "Easy" )
  1261.     PORT_DIPSETTING(    0x0c, "Normal" )
  1262.     PORT_DIPSETTING(    0x08, "Hard" )
  1263.     PORT_DIPSETTING(    0x00, "Hardest" )
  1264.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1265.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1266.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1267.     PORT_DIPNAME( 0x40, 0x00, "Allow Continue" )
  1268.     PORT_DIPSETTING(    0x40, DEF_STR( No ) )
  1269.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  1270.     PORT_DIPNAME( 0x80, 0x80, "Freeze" )
  1271.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1272.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1273. INPUT_PORTS_END
  1274.  
  1275. INPUT_PORTS_START( srdarwin )
  1276.     PORT_START
  1277.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1278.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1279.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  1280.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  1281.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1282.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1283.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  1284.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  1285.  
  1286.     PORT_START
  1287.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1288.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  1289.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  1290.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1291.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  1292.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  1293.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
  1294.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1295.  
  1296.     PORT_START
  1297.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1298.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1299.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1300.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1301.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1302.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1303.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1304.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1305.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1306.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1307.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
  1308.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1309.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1310.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1311.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1312.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1313.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1314.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1315.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1316.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
  1317.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1318.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1319.  
  1320.     PORT_START
  1321.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1322.     PORT_DIPSETTING(    0x01, "1" )
  1323.     PORT_DIPSETTING(    0x03, "3" )
  1324.     PORT_DIPSETTING(    0x02, "5" )
  1325.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "28", IP_KEY_NONE, IP_JOY_NONE )
  1326.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1327.     PORT_DIPSETTING(    0x04, "Easy" )
  1328.     PORT_DIPSETTING(    0x0c, "Normal" )
  1329.     PORT_DIPSETTING(    0x08, "Hard" )
  1330.     PORT_DIPSETTING(    0x00, "Hardest" )
  1331.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  1332.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1333.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1334.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  1335.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1336.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1337.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  1338.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1339.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1340.     PORT_DIPNAME( 0x80, 0x80, "Continues" )
  1341.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1342.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1343.  
  1344.     PORT_START
  1345.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) /* Fake */
  1346. INPUT_PORTS_END
  1347.  
  1348. INPUT_PORTS_START( gondo )
  1349.     PORT_START    /* Player 1 controls */
  1350.     PLAYER1_JOYSTICK
  1351.     /* Top 4 bits are rotary controller */
  1352.  
  1353.      PORT_START    /* Player 2 controls */
  1354.     PLAYER2_JOYSTICK
  1355.     /* Top 4 bits are rotary controller */
  1356.  
  1357.      PORT_START    /* Player 1 & 2 fire buttons */
  1358.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1359.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1360.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1361.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1362.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1363.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1364.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1365.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1366.  
  1367.     PORT_START    /* IN1 */
  1368.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1369.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1370.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1371.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1372.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1373.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1374.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1375.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1376.  
  1377.     PORT_START /* Fake port for the i8751 */
  1378.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1379.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1380.  
  1381.     PORT_START    /* player 1 12-way rotary control */
  1382.     PORT_ANALOGX( 0xff, 0x00, IPT_DIAL | IPF_REVERSE, 25, 10, 0, 0, KEYCODE_Z, KEYCODE_X, 0, 0 )
  1383.  
  1384.     PORT_START    /* player 2 12-way rotary control */
  1385.     PORT_ANALOGX( 0xff, 0x00, IPT_DIAL | IPF_REVERSE | IPF_PLAYER2, 25, 10, 0, 0, KEYCODE_N, KEYCODE_M, 0, 0 )
  1386.  
  1387.     PORT_START    /* Dip switch bank 1 */
  1388.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1389.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1390.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1391.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1392.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1393.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1394.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1395.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1396.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1397.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1398.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1399.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1400.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1401.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1402.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1403.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1404.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1405.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1406.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1407.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1408.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1409.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1410.  
  1411.     PORT_START    /* Dip switch bank 2 */
  1412.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1413.     PORT_DIPSETTING(    0x01, "1" )
  1414.     PORT_DIPSETTING(    0x03, "3" )
  1415.     PORT_DIPSETTING(    0x02, "5" )
  1416.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1417.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1418.     PORT_DIPSETTING(    0x04, "Easy" )
  1419.     PORT_DIPSETTING(    0x0c, "Normal" )
  1420.     PORT_DIPSETTING(    0x08, "Hard" )
  1421.     PORT_DIPSETTING(    0x00, "Hardest" )
  1422.     PORT_DIPNAME( 0x10, 0x10, "Allow Continue" )
  1423.     PORT_DIPSETTING(    0x10, DEF_STR( No ) )
  1424.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  1425.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1426.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1427.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1428.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1429.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1430.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1431.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1432.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1433.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1434. INPUT_PORTS_END
  1435.  
  1436. INPUT_PORTS_START( oscar )
  1437.     PORT_START    /* Player 1 controls */
  1438.     PLAYER1_JOYSTICK
  1439.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1440.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1441.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  1442.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  1443.  
  1444.      PORT_START    /* Player 2 controls */
  1445.     PLAYER2_JOYSTICK
  1446.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  1447.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  1448.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  1449.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  1450.  
  1451.     PORT_START    /* IN1 */
  1452.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1453.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1454.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  1455.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1456.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1457.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1458.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1459.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1460.  
  1461.     PORT_START    /* Dip switch bank 1 */
  1462.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1463.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  1464.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1465.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1466.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  1467.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1468.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  1469.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1470.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1471.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  1472.     PORT_DIPNAME( 0x20, 0x20, "Demo Freeze Mode" )
  1473.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1474.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1475.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1476.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1477.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1478.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1479.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1480.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1481.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  1482.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1483.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1484.  
  1485.     PORT_START    /* Dip switch bank 2 */
  1486.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1487.     PORT_DIPSETTING(    0x01, "1" )
  1488.     PORT_DIPSETTING(    0x03, "3" )
  1489.     PORT_DIPSETTING(    0x02, "5" )
  1490.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1491.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1492.     PORT_DIPSETTING(    0x04, "Easy" )
  1493.     PORT_DIPSETTING(    0x0c, "Normal" )
  1494.     PORT_DIPSETTING(    0x08, "Hard" )
  1495.     PORT_DIPSETTING(    0x00, "Hardest" )
  1496.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
  1497.     PORT_DIPSETTING(    0x30, "Every 40000" )
  1498.     PORT_DIPSETTING(    0x20, "Every 60000" )
  1499.     PORT_DIPSETTING(    0x10, "Every 90000" )
  1500.     PORT_DIPSETTING(    0x00, "50000 only" )
  1501.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) //invincible?
  1502.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1503.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1504.     PORT_DIPNAME( 0x80, 0x80, "Allow Continue" )
  1505.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  1506.     PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
  1507. INPUT_PORTS_END
  1508.  
  1509. INPUT_PORTS_START( lastmiss )
  1510.     PORT_START    /* Player 1 controls */
  1511.     PLAYER1_JOYSTICK
  1512.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1513.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1514.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  1515.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1516.  
  1517.      PORT_START    /* Player 2 controls */
  1518.     PLAYER2_JOYSTICK
  1519.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  1520.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  1521.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  1522.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1523.  
  1524.     PORT_START    /* IN1 */
  1525.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1526.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1527.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  1528.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  1529.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1530.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1531.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1532.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1533.  
  1534.     PORT_START    /* Dip switch bank 1 */
  1535.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1536.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1537.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1538.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1539.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1540.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1541.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1542.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1543.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1544.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1545.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
  1546.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1547.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1548.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1549.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1550.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1551.     PORT_BITX( 0x40,    0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1552.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1553.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1554.     PORT_DIPNAME( 0x80, 0x00, "Cabinet?" )
  1555.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1556.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1557.  
  1558.     PORT_START    /* Dip switch bank 2 */
  1559.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1560.     PORT_DIPSETTING(    0x03, "3" )
  1561.     PORT_DIPSETTING(    0x02, "4" )
  1562.     PORT_DIPSETTING(    0x01, "5" )
  1563.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1564.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1565.     PORT_DIPSETTING(    0x04, "Easy" )
  1566.     PORT_DIPSETTING(    0x0c, "Normal" )
  1567.     PORT_DIPSETTING(    0x08, "Hard" )
  1568.     PORT_DIPSETTING(    0x00, "Hardest" )
  1569.     PORT_DIPNAME( 0x10, 0x10, "Allow Continue?" )
  1570.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  1571.     PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
  1572.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1573.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1574.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1575.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1576.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1577.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1578.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1579.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1580.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1581. INPUT_PORTS_END
  1582.  
  1583. INPUT_PORTS_START( shackled )
  1584.     PORT_START    /* Player 1 controls */
  1585.     PLAYER1_JOYSTICK
  1586.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1587.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1588.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1589.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1590.  
  1591.      PORT_START    /* Player 2 controls */
  1592.     PLAYER2_JOYSTICK
  1593.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1594.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1595.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1596.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1597.  
  1598.     PORT_START
  1599.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1600.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1601.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  1602.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  1603.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1604.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1605.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1606.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1607.  
  1608.     PORT_START    /* Dip switch bank 1 */
  1609.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1610.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1611.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1612.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1613.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1614.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1615.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1616.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1617.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1618.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1619.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )    /* game doesn't boot when this is On */
  1620.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1621.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1622.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1623.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1624.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1625.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1626.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1627.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1628.     PORT_DIPNAME( 0x80, 0x80, "Freeze" )
  1629.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1630.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1631.  
  1632.     PORT_START    /* Dip switch bank 2 */
  1633.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1634.     PORT_DIPSETTING(    0x03, "3" )
  1635.     PORT_DIPSETTING(    0x02, "4" )
  1636.     PORT_DIPSETTING(    0x01, "5" )
  1637.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1638.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1639.     PORT_DIPSETTING(    0x04, "Easy" )
  1640.     PORT_DIPSETTING(    0x0c, "Normal" )
  1641.     PORT_DIPSETTING(    0x08, "Hard" )
  1642.     PORT_DIPSETTING(    0x00, "Hardest" )
  1643.     PORT_DIPNAME( 0x10, 0x10, "Allow Continue" )
  1644.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  1645.     PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
  1646.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1647.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1648.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1649.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1650.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1651.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1652.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1653.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1654.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1655. INPUT_PORTS_END
  1656.  
  1657. INPUT_PORTS_START( csilver )
  1658.     PORT_START    /* Player 1 controls */
  1659.     PLAYER1_JOYSTICK
  1660.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1661.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1662.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1663.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1664.  
  1665.      PORT_START    /* Player 2 controls */
  1666.     PLAYER2_JOYSTICK
  1667.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  1668.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  1669.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1670.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1671.  
  1672.     PORT_START
  1673.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1674.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1675.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  1676.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  1677.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1678.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1679.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1680.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1681.  
  1682.     PORT_START    /* Dip switch bank 1 */
  1683.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1684.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1685.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1686.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1687.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1688.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1689.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1690.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1691.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1692.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1693.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1694.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1695.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1696.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1697.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1698.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1699.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1700.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1701.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1702.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  1703.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1704.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1705.  
  1706.     PORT_START    /* Dip switch bank 2 */
  1707.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1708.     PORT_DIPSETTING(    0x01, "1" )
  1709.     PORT_DIPSETTING(    0x03, "3" )
  1710.     PORT_DIPSETTING(    0x02, "5" )
  1711.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1712.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1713.     PORT_DIPSETTING(    0x04, "Easy" )
  1714.     PORT_DIPSETTING(    0x0c, "Normal" )
  1715.     PORT_DIPSETTING(    0x08, "Hard" )
  1716.     PORT_DIPSETTING(    0x00, "Hardest" )
  1717.     PORT_DIPNAME( 0x10, 0x10, "Allow Continue" )
  1718.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  1719.     PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
  1720.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1721.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1722.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1723.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1724.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1725.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1726.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1727.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1728.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1729. INPUT_PORTS_END
  1730.  
  1731. INPUT_PORTS_START( garyoret )
  1732.     PORT_START    /* Player 1 controls */
  1733.     PLAYER1_JOYSTICK
  1734.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1735.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1736.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  1737.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  1738.  
  1739.      PORT_START    /* Player 2 controls */
  1740.     PLAYER2_JOYSTICK
  1741.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1742.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1743.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1744.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1745.  
  1746.     PORT_START /* Fake port for i8751 */
  1747.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1748.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1749.  
  1750.     PORT_START    /* Dip switch bank 1 */
  1751.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  1752.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1753.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1754.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  1755.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  1756.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  1757.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  1758.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  1759.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  1760.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  1761.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
  1762.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1763.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1764.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  1765.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1766.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1767.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  1768.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1769.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1770.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
  1771.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1772.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1773.  
  1774.     PORT_START    /* Dip switch bank 2 */
  1775.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  1776.     PORT_DIPSETTING(    0x01, "3" )
  1777.     PORT_DIPSETTING(    0x00, "5" )
  1778.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
  1779.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  1780.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1781.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  1782.     PORT_DIPSETTING(    0x04, "Easy" )
  1783.     PORT_DIPSETTING(    0x0c, "Normal" )
  1784.     PORT_DIPSETTING(    0x08, "Hard" )
  1785.     PORT_DIPSETTING(    0x00, "Hardest" )
  1786.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
  1787.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1788.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1789.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
  1790.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1791.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1792.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
  1793.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1794.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1795.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
  1796.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1797.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1798. INPUT_PORTS_END
  1799.  
  1800. /******************************************************************************/
  1801.  
  1802. static struct GfxLayout charlayout_32k =
  1803. {
  1804.     8,8,
  1805.     1024,
  1806.     2,
  1807.     { 0x4000*8,0x0000*8 },
  1808.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1809.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1810.     8*8    /* every sprite takes 8 consecutive bytes */
  1811. };
  1812.  
  1813. static struct GfxLayout chars_3bpp =
  1814. {
  1815.     8,8,
  1816.     1024,
  1817.     3,
  1818.     { 0x6000*8,0x4000*8,0x2000*8 },
  1819.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1820.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1821.     8*8    /* every sprite takes 8 consecutive bytes */
  1822. };
  1823.  
  1824. /* SRDarwin characters - very unusual layout for Data East */
  1825. static struct GfxLayout charlayout_16k =
  1826. {
  1827.     8,8,    /* 8*8 characters */
  1828.     1024,
  1829.     2,    /* 2 bits per pixel */
  1830.     { 0, 4 },    /* the two bitplanes for 4 pixels are packed into one byte */
  1831.     { 0x2000*8+0, 0x2000*8+1, 0x2000*8+2, 0x2000*8+3, 0, 1, 2, 3 },
  1832.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1833.     8*8    /* every char takes 8 consecutive bytes */
  1834. };
  1835.  
  1836. static struct GfxLayout oscar_charlayout =
  1837. {
  1838.     8,8,
  1839.     1024,
  1840.     3,
  1841.     { 0x3000*8,0x2000*8,0x1000*8 },
  1842.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1843.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1844.     8*8    /* every sprite takes 8 consecutive bytes */
  1845. };
  1846.  
  1847. /* Darwin sprites - only 3bpp */
  1848. static struct GfxLayout sr_sprites =
  1849. {
  1850.     16,16,
  1851.     2048,
  1852.     3,
  1853.      { 0x10000*8,0x20000*8,0x00000*8 },
  1854.     { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),
  1855.         0,1,2,3,4,5,6,7 },
  1856.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 },
  1857.     16*16
  1858. };
  1859.  
  1860. static struct GfxLayout srdarwin_tiles =
  1861. {
  1862.     16,16,
  1863.     256,
  1864.     4,
  1865.     { 0x8000*8, 0x8000*8+4, 0, 4 },
  1866.     { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3,
  1867.             16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 },
  1868.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1869.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  1870.     32*8    /* every tile takes 32 consecutive bytes */
  1871. };
  1872.  
  1873. static struct GfxLayout tiles =
  1874. {
  1875.     16,16,
  1876.     4096,
  1877.     4,
  1878.      { 0x60000*8,0x40000*8,0x20000*8,0x00000*8 },
  1879.     { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8),
  1880.         0,1,2,3,4,5,6,7 },
  1881.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8},
  1882.     16*16
  1883. };
  1884.  
  1885. /* X flipped on Ghostbusters tiles */
  1886. static struct GfxLayout tiles_r =
  1887. {
  1888.     16,16,
  1889.     2048,
  1890.     4,
  1891.      { 0x20000*8,0x00000*8,0x30000*8,0x10000*8 },
  1892.     { 7,6,5,4,3,2,1,0,
  1893.         7+(16*8), 6+(16*8), 5+(16*8), 4+(16*8), 3+(16*8), 2+(16*8), 1+(16*8), 0+(16*8) },
  1894.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8},
  1895.     16*16
  1896. };
  1897.  
  1898. static struct GfxDecodeInfo cobracom_gfxdecodeinfo[] =
  1899. {
  1900.     { REGION_GFX1, 0, &charlayout_32k, 0, 8 },
  1901.     { REGION_GFX2, 0, &tiles,         64, 4 },
  1902.     { REGION_GFX3, 0, &tiles,        192, 4 },
  1903.     { REGION_GFX4, 0, &tiles,        128, 4 },
  1904.     { -1 } /* end of array */
  1905. };
  1906.  
  1907. static struct GfxDecodeInfo ghostb_gfxdecodeinfo[] =
  1908. {
  1909.     { REGION_GFX1, 0, &chars_3bpp,    0,  4 },
  1910.     { REGION_GFX2, 0, &tiles,     256, 16 },
  1911.     { REGION_GFX3, 0, &tiles_r,   512, 16 },
  1912.     { -1 } /* end of array */
  1913. };
  1914.  
  1915. static struct GfxDecodeInfo srdarwin_gfxdecodeinfo[] =
  1916. {
  1917.     { REGION_GFX1, 0x00000, &charlayout_16k,128, 4 }, /* Only 1 used so far :/ */
  1918.     { REGION_GFX2, 0x00000, &sr_sprites,     64, 8 },
  1919.     { REGION_GFX3, 0x00000, &srdarwin_tiles,  0, 8 },
  1920.       { REGION_GFX3, 0x10000, &srdarwin_tiles,  0, 8 },
  1921.     { REGION_GFX3, 0x20000, &srdarwin_tiles,  0, 8 },
  1922.     { REGION_GFX3, 0x30000, &srdarwin_tiles,  0, 8 },
  1923.     { -1 } /* end of array */
  1924. };
  1925.  
  1926. static struct GfxDecodeInfo gondo_gfxdecodeinfo[] =
  1927. {
  1928.     { REGION_GFX1, 0, &chars_3bpp,  0, 16 }, /* Chars */
  1929.     { REGION_GFX2, 0, &tiles,     256, 32 }, /* Sprites */
  1930.     { REGION_GFX3, 0, &tiles,     768, 16 }, /* Tiles */
  1931.      { -1 } /* end of array */
  1932. };
  1933.  
  1934. static struct GfxDecodeInfo oscar_gfxdecodeinfo[] =
  1935. {
  1936.     { REGION_GFX1, 0, &oscar_charlayout, 256,  8 }, /* Chars */
  1937.     { REGION_GFX2, 0, &tiles,              0, 16 }, /* Sprites */
  1938.     { REGION_GFX3, 0, &tiles,            384,  8 }, /* Tiles */
  1939.      { -1 } /* end of array */
  1940. };
  1941.  
  1942. static struct GfxDecodeInfo shackled_gfxdecodeinfo[] =
  1943. {
  1944.     { REGION_GFX1, 0, &chars_3bpp,   0,  4 },
  1945.     { REGION_GFX2, 0, &tiles,      256, 16 },
  1946.     { REGION_GFX3, 0, &tiles,      768, 16 },
  1947.      { -1 } /* end of array */
  1948. };
  1949.  
  1950. /******************************************************************************/
  1951.  
  1952. static struct YM2203interface ym2203_interface =
  1953. {
  1954.     1,
  1955.     1500000,    /* Should be accurate for all games, derived from 12MHz crystal */
  1956.     { YM2203_VOL(20,23) },
  1957.     { 0 },
  1958.     { 0 },
  1959.     { 0 },
  1960.     { 0 }
  1961. };
  1962.  
  1963. /* handler called by the 3812 emulator when the internal timers cause an IRQ */
  1964. static void irqhandler(int linestate)
  1965. {
  1966.     cpu_set_irq_line(1,0,linestate); /* M6502_INT_IRQ */
  1967. }
  1968.  
  1969. static void oscar_irqhandler(int linestate)
  1970. {
  1971.     cpu_set_irq_line(2,0,linestate); /* M6502_INT_IRQ */
  1972. }
  1973.  
  1974. static struct YM3526interface ym3526_interface =
  1975. {
  1976.     1,            /* 1 chip */
  1977.     3000000,    /* 3 MHz */
  1978.     { 35 },
  1979.     { irqhandler },
  1980. };
  1981.  
  1982. static struct YM3526interface oscar_ym3526_interface =
  1983. {
  1984.     1,            /* 1 chip */
  1985.     3000000,    /* 3 MHz */
  1986.     { 35 },
  1987.     { oscar_irqhandler },
  1988. };
  1989.  
  1990. static struct YM3812interface ym3812_interface =
  1991. {
  1992.     1,            /* 1 chip */
  1993.     3000000,    /* 3 MHz */
  1994.     { 35 },
  1995.     { irqhandler },
  1996. };
  1997.  
  1998. static struct MSM5205interface msm5205_interface =
  1999. {
  2000.     1,                    /* 1 chip             */
  2001.     384000,                /* 384KHz             */
  2002.     { csilver_adpcm_int },/* interrupt function */
  2003.     { MSM5205_S48_4B },    /* 8KHz               */
  2004.     { 88 }
  2005. };
  2006.  
  2007. /******************************************************************************/
  2008.  
  2009. static int ghostb_interrupt(void)
  2010. {
  2011.     static int latch[4];
  2012.     int i8751_out=readinputport(4);
  2013.  
  2014.     /* Ghostbusters coins are controlled by the i8751 */
  2015.     if ((i8751_out & 0x8) == 0x8) latch[0]=1;
  2016.     if ((i8751_out & 0x4) == 0x4) latch[1]=1;
  2017.     if ((i8751_out & 0x2) == 0x2) latch[2]=1;
  2018.     if ((i8751_out & 0x1) == 0x1) latch[3]=1;
  2019.  
  2020.     if (((i8751_out & 0x8) != 0x8) && latch[0]) {latch[0]=0; cpu_cause_interrupt(0,M6809_INT_IRQ); i8751_return=0x8001; } /* Player 1 coin */
  2021.     if (((i8751_out & 0x4) != 0x4) && latch[1]) {latch[1]=0; cpu_cause_interrupt(0,M6809_INT_IRQ); i8751_return=0x4001; } /* Player 2 coin */
  2022.     if (((i8751_out & 0x2) != 0x2) && latch[2]) {latch[2]=0; cpu_cause_interrupt(0,M6809_INT_IRQ); i8751_return=0x2001; } /* Player 3 coin */
  2023.     if (((i8751_out & 0x1) != 0x1) && latch[3]) {latch[3]=0; cpu_cause_interrupt(0,M6809_INT_IRQ); i8751_return=0x1001; } /* Service */
  2024.  
  2025.     if (nmi_enable) return M6809_INT_NMI; /* VBL */
  2026.  
  2027.     return 0; /* VBL */
  2028. }
  2029.  
  2030. static int gondo_interrupt(void)
  2031. {
  2032.     if (nmi_enable)
  2033.         return M6809_INT_NMI; /* VBL */
  2034.  
  2035.     return 0; /* VBL */
  2036. }
  2037.  
  2038. /* Coins generate NMI's */
  2039. static int oscar_interrupt(void)
  2040. {
  2041.     static int latch=1;
  2042.  
  2043.     if ((readinputport(2) & 0x7) == 0x7) latch=1;
  2044.     if (latch && (readinputport(2) & 0x7) != 0x7) {
  2045.         latch=0;
  2046.         cpu_cause_interrupt (0, M6809_INT_NMI);
  2047.     }
  2048.  
  2049.     return 0;
  2050. }
  2051.  
  2052. /******************************************************************************/
  2053.  
  2054. static struct MachineDriver machine_driver_cobracom =
  2055. {
  2056.     /* basic machine hardware */
  2057.     {
  2058.          {
  2059.             CPU_M6809,
  2060.             2000000,
  2061.             cobra_readmem,cobra_writemem,0,0,
  2062.             nmi_interrupt,1
  2063.         },
  2064.         {
  2065.             CPU_M6502 | CPU_AUDIO_CPU,
  2066.             1500000,
  2067.             dec8_s_readmem,dec8_s_writemem,0,0,
  2068.             ignore_interrupt,0    /* IRQs are caused by the YM3812 */
  2069.                                 /* NMIs are caused by the main CPU */
  2070.         }
  2071.     },
  2072.     58, 529, /* 58Hz, 529ms Vblank duration */
  2073.     1,
  2074.     0,    /* init machine */
  2075.  
  2076.     /* video hardware */
  2077.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2078.  
  2079.     cobracom_gfxdecodeinfo,
  2080.     256,256,
  2081.     0,
  2082.  
  2083.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2084.     0,
  2085.     cobracom_vh_start,
  2086.     0,
  2087.     cobracom_vh_screenrefresh,
  2088.  
  2089.     /* sound hardware */
  2090.     0,0,0,0,
  2091.     {
  2092.         {
  2093.             SOUND_YM2203,
  2094.             &ym2203_interface
  2095.         },
  2096.         {
  2097.             SOUND_YM3812,
  2098.             &ym3812_interface
  2099.         }
  2100.     }
  2101. };
  2102.  
  2103. static struct MachineDriver machine_driver_ghostb =
  2104. {
  2105.     /* basic machine hardware */
  2106.     {
  2107.         {
  2108.             CPU_HD6309,
  2109.             3000000,
  2110.             ghostb_readmem,ghostb_writemem,0,0,
  2111.             ghostb_interrupt,1
  2112.         },
  2113.         {
  2114.             CPU_M6502 | CPU_AUDIO_CPU,
  2115.             1500000,
  2116.             dec8_s_readmem,dec8_s_writemem,0,0,
  2117.             ignore_interrupt,0    /* IRQs are caused by the YM3812 */
  2118.                                 /* NMIs are caused by the main CPU */
  2119.         }
  2120.     },
  2121.     58, 2500, /* 58Hz, 529ms Vblank duration */
  2122.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2123.     0,    /* init machine */
  2124.  
  2125.     /* video hardware */
  2126.       32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2127.  
  2128.     ghostb_gfxdecodeinfo,
  2129.     1024,1024,
  2130.     ghostb_vh_convert_color_prom,
  2131.  
  2132.     VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2133.     dec8_eof_callback,
  2134.     ghostb_vh_start,
  2135.     0,
  2136.     ghostb_vh_screenrefresh,
  2137.  
  2138.     /* sound hardware */
  2139.     0,0,0,0,
  2140.     {
  2141.         {
  2142.             SOUND_YM2203,
  2143.             &ym2203_interface
  2144.         },
  2145.         {
  2146.             SOUND_YM3812,
  2147.             &ym3812_interface
  2148.         }
  2149.     }
  2150. };
  2151.  
  2152. static struct MachineDriver machine_driver_srdarwin =
  2153. {
  2154.     /* basic machine hardware */
  2155.     {
  2156.         {
  2157.             CPU_M6809,  /* MC68A09EP */
  2158.             2000000,
  2159.             srdarwin_readmem,srdarwin_writemem,0,0,
  2160.             nmi_interrupt,1
  2161.         },
  2162.         {
  2163.             CPU_M6502 | CPU_AUDIO_CPU,
  2164.             1500000,
  2165.             dec8_s_readmem,dec8_s_writemem,0,0,
  2166.             ignore_interrupt,0    /* IRQs are caused by the YM3812 */
  2167.                                 /* NMIs are caused by the main CPU */
  2168.         }
  2169.     },
  2170.     58, 529, /* 58Hz, 529ms Vblank duration */
  2171.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2172.     0,    /* init machine */
  2173.  
  2174.     /* video hardware */
  2175.       32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2176.  
  2177.     srdarwin_gfxdecodeinfo,
  2178.     144,144,
  2179.     0,
  2180.  
  2181.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2182.     0,
  2183.     srdarwin_vh_start,
  2184.     0,
  2185.     srdarwin_vh_screenrefresh,
  2186.  
  2187.     /* sound hardware */
  2188.     0,0,0,0,
  2189.     {
  2190.         {
  2191.             SOUND_YM2203,
  2192.             &ym2203_interface
  2193.         },
  2194.         {
  2195.             SOUND_YM3812,
  2196.             &ym3812_interface
  2197.         }
  2198.     }
  2199. };
  2200.  
  2201. static struct MachineDriver machine_driver_gondo =
  2202. {
  2203.     /* basic machine hardware */
  2204.     {
  2205.          {
  2206.             CPU_HD6309, /* HD63C09EP */
  2207.             3000000,
  2208.             gondo_readmem,gondo_writemem,0,0,
  2209.             gondo_interrupt,1
  2210.         },
  2211.         {
  2212.             CPU_M6502 | CPU_AUDIO_CPU,
  2213.             1500000,
  2214.             dec8_s_readmem,dec8_s_writemem,0,0,
  2215.             ignore_interrupt,0    /* IRQs are caused by the YM3526 */
  2216.                                 /* NMIs are caused by the main CPU */
  2217.         }
  2218.     },
  2219.     58, 529, /* 58Hz, 529ms Vblank duration */
  2220.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2221.     0,    /* init machine */
  2222.  
  2223.     /* video hardware */
  2224.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2225.  
  2226.     gondo_gfxdecodeinfo,
  2227.     1024,1024,
  2228.     0,
  2229.  
  2230.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2231.     dec8_eof_callback,
  2232.     gondo_vh_start,
  2233.     0,
  2234.     gondo_vh_screenrefresh,
  2235.  
  2236.     /* sound hardware */
  2237.     0,0,0,0,
  2238.     {
  2239.         {
  2240.             SOUND_YM2203,
  2241.             &ym2203_interface
  2242.         },
  2243.         {
  2244.             SOUND_YM3526,
  2245.             &ym3526_interface
  2246.         }
  2247.     }
  2248. };
  2249.  
  2250. static struct MachineDriver machine_driver_oscar =
  2251. {
  2252.     /* basic machine hardware */
  2253.     {
  2254.           {
  2255.             CPU_HD6309,
  2256.             2000000,
  2257.             oscar_readmem,oscar_writemem,0,0,
  2258.             oscar_interrupt,1
  2259.         },
  2260.          {
  2261.             CPU_HD6309,
  2262.             2000000,
  2263.             oscar_sub_readmem,oscar_sub_writemem,0,0,
  2264.             ignore_interrupt,0
  2265.         },
  2266.         {
  2267.             CPU_M6502 | CPU_AUDIO_CPU,
  2268.             1500000,
  2269.             dec8_s_readmem,dec8_s_writemem,0,0,
  2270.             ignore_interrupt,0    /* IRQs are caused by the YM3526 */
  2271.                                 /* NMIs are caused by the main CPU */
  2272.         }
  2273.     },
  2274.     58, 2500, /* 58Hz, 529ms Vblank duration */
  2275.     40, /* 40 CPU slices per frame */
  2276.     0,    /* init machine */
  2277.  
  2278.     /* video hardware */
  2279.       32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2280.  
  2281.     oscar_gfxdecodeinfo,
  2282.     512,512,
  2283.     0,
  2284.  
  2285.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2286.     0,
  2287.     oscar_vh_start,
  2288.     0,
  2289.     oscar_vh_screenrefresh,
  2290.  
  2291.     /* sound hardware */
  2292.     0,0,0,0,
  2293.     {
  2294.         {
  2295.             SOUND_YM2203,
  2296.             &ym2203_interface
  2297.         },
  2298.         {
  2299.             SOUND_YM3526,
  2300.             &oscar_ym3526_interface
  2301.         }
  2302.     }
  2303. };
  2304.  
  2305. static struct MachineDriver machine_driver_lastmiss =
  2306. {
  2307.     /* basic machine hardware */
  2308.     {
  2309.           {
  2310.             CPU_M6809,
  2311.             2000000,
  2312.             lastmiss_readmem,lastmiss_writemem,0,0,
  2313.             ignore_interrupt,0
  2314.         },
  2315.          {
  2316.             CPU_M6809,
  2317.             2000000,
  2318.             lastmiss_sub_readmem,lastmiss_sub_writemem,0,0,
  2319.             ignore_interrupt,0
  2320.         },
  2321.         {
  2322.             CPU_M6502 | CPU_AUDIO_CPU,
  2323.             1500000,
  2324.             ym3526_s_readmem,ym3526_s_writemem,0,0,
  2325.             ignore_interrupt,0    /* IRQs are caused by the YM3526 */
  2326.                                 /* NMIs are caused by the main CPU */
  2327.         }
  2328.     },
  2329.     58, 2500, /* 58Hz, 529ms Vblank duration */
  2330.     200,
  2331.     0,    /* init machine */
  2332.  
  2333.     /* video hardware */
  2334.       32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2335.  
  2336.     shackled_gfxdecodeinfo,
  2337.     1024,1024,
  2338.     0,
  2339.  
  2340.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2341.     0,
  2342.     lastmiss_vh_start,
  2343.     0,
  2344.     lastmiss_vh_screenrefresh,
  2345.  
  2346.     /* sound hardware */
  2347.     0,0,0,0,
  2348.     {
  2349.         {
  2350.             SOUND_YM2203,
  2351.             &ym2203_interface
  2352.         },
  2353.         {
  2354.             SOUND_YM3526,
  2355.             &oscar_ym3526_interface
  2356.         }
  2357.     }
  2358. };
  2359.  
  2360. static struct MachineDriver machine_driver_shackled =
  2361. {
  2362.     /* basic machine hardware */
  2363.     {
  2364.           {
  2365.             CPU_M6809,
  2366.             2000000,
  2367.             shackled_readmem,shackled_writemem,0,0,
  2368.                ignore_interrupt,0
  2369.         },
  2370.          {
  2371.             CPU_M6809,
  2372.             2000000,
  2373.             shackled_sub_readmem,shackled_sub_writemem,0,0,
  2374.             ignore_interrupt,0
  2375.         },
  2376.         {
  2377.             CPU_M6502 | CPU_AUDIO_CPU,
  2378.             1500000,
  2379.             ym3526_s_readmem,ym3526_s_writemem,0,0,
  2380.             ignore_interrupt,0    /* IRQs are caused by the YM3526 */
  2381.                                 /* NMIs are caused by the main CPU */
  2382.         }
  2383.     },
  2384.     58, 2500, /* 58Hz, 529ms Vblank duration */
  2385.     80,
  2386.     0,    /* init machine */
  2387.  
  2388.     /* video hardware */
  2389.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2390.  
  2391.     shackled_gfxdecodeinfo,
  2392.     1024,1024,
  2393.     0,
  2394.  
  2395.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2396.     0,
  2397.     shackled_vh_start,
  2398.     0,
  2399.     shackled_vh_screenrefresh,
  2400.  
  2401.     /* sound hardware */
  2402.     0,0,0,0,
  2403.     {
  2404.         {
  2405.             SOUND_YM2203,
  2406.             &ym2203_interface
  2407.         },
  2408.         {
  2409.             SOUND_YM3526,
  2410.             &oscar_ym3526_interface
  2411.         }
  2412.     }
  2413. };
  2414.  
  2415. static struct MachineDriver machine_driver_csilver =
  2416. {
  2417.     /* basic machine hardware */
  2418.     {
  2419.           {
  2420.             CPU_M6809,
  2421.             2000000,
  2422.             csilver_readmem,csilver_writemem,0,0,
  2423.                ignore_interrupt,0
  2424.         },
  2425.          {
  2426.             CPU_M6809,
  2427.             2000000,
  2428.             csilver_sub_readmem,csilver_sub_writemem,0,0,
  2429.             nmi_interrupt,1
  2430.         },
  2431.         {
  2432.             CPU_M6502 | CPU_AUDIO_CPU,
  2433.             1500000,
  2434.             csilver_s_readmem,csilver_s_writemem,0,0,
  2435.             ignore_interrupt,0    /* IRQs are caused by the MSM5205 */
  2436.                                 /* NMIs are caused by the main CPU */
  2437.         }
  2438.     },
  2439.     58, 529, /* 58Hz, 529ms Vblank duration */
  2440.     60,
  2441.     0,    /* init machine */
  2442.  
  2443.     /* video hardware */
  2444.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2445.  
  2446.     shackled_gfxdecodeinfo,
  2447.     1024,1024,
  2448.     0,
  2449.  
  2450.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2451.     0,
  2452.     lastmiss_vh_start,
  2453.     0,
  2454.     lastmiss_vh_screenrefresh,
  2455.  
  2456.     /* sound hardware */
  2457.     0,0,0,0,
  2458.     {
  2459.         {
  2460.             SOUND_YM2203,
  2461.             &ym2203_interface
  2462.         },
  2463.         {
  2464.             SOUND_YM3526,
  2465.             &oscar_ym3526_interface
  2466.         },
  2467.         {
  2468.             SOUND_MSM5205,
  2469.             &msm5205_interface
  2470.         }
  2471.     }
  2472. };
  2473.  
  2474. static struct MachineDriver machine_driver_garyoret =
  2475. {
  2476.     /* basic machine hardware */
  2477.     {
  2478.          {
  2479.             CPU_HD6309, /* HD63C09EP */
  2480.             3000000,
  2481.             garyoret_readmem,garyoret_writemem,0,0,
  2482.             gondo_interrupt,1
  2483.         },
  2484.         {
  2485.             CPU_M6502 | CPU_AUDIO_CPU,
  2486.             1500000,
  2487.             dec8_s_readmem,dec8_s_writemem,0,0,
  2488.             ignore_interrupt,0    /* IRQs are caused by the YM3526 */
  2489.                                 /* NMIs are caused by the main CPU */
  2490.         }
  2491.     },
  2492.     58, 529, /* 58Hz, 529ms Vblank duration */
  2493.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2494.     0,    /* init machine */
  2495.  
  2496.     /* video hardware */
  2497.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  2498.  
  2499.     gondo_gfxdecodeinfo,
  2500.     1024,1024,
  2501.     0,
  2502.  
  2503.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  2504.     dec8_eof_callback,
  2505.     garyoret_vh_start,
  2506.     0,
  2507.     garyoret_vh_screenrefresh,
  2508.  
  2509.     /* sound hardware */
  2510.     0,0,0,0,
  2511.     {
  2512.         {
  2513.             SOUND_YM2203,
  2514.             &ym2203_interface
  2515.         },
  2516.         {
  2517.             SOUND_YM3526,
  2518.             &ym3526_interface
  2519.         }
  2520.     }
  2521. };
  2522.  
  2523. /******************************************************************************/
  2524.  
  2525. ROM_START( cobracom )
  2526.     ROM_REGION( 0x30000, REGION_CPU1 )
  2527.     ROM_LOAD( "el11-5.bin",  0x08000, 0x08000, 0xaf0a8b05 )
  2528.     ROM_LOAD( "el12-4.bin",  0x10000, 0x10000, 0x7a44ef38 )
  2529.     ROM_LOAD( "el13.bin",    0x20000, 0x10000, 0x04505acb )
  2530.  
  2531.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  2532.     ROM_LOAD( "el10-4.bin",  0x8000,  0x8000,  0xedfad118 )
  2533.  
  2534.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2535.     ROM_LOAD( "el14.bin",    0x00000, 0x08000, 0x47246177 )
  2536.  
  2537.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2538.     ROM_LOAD( "el00-4.bin",  0x00000, 0x10000, 0x122da2a8 )
  2539.     ROM_LOAD( "el01-4.bin",  0x20000, 0x10000, 0x27bf705b )
  2540.     ROM_LOAD( "el02-4.bin",  0x40000, 0x10000, 0xc86fede6 )
  2541.     ROM_LOAD( "el03-4.bin",  0x60000, 0x10000, 0x1d8a855b )
  2542.  
  2543.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles 1 */
  2544.     ROM_LOAD( "el05.bin",    0x00000, 0x10000, 0x1c4f6033 )
  2545.     ROM_LOAD( "el06.bin",    0x20000, 0x10000, 0xd24ba794 )
  2546.     ROM_LOAD( "el04.bin",    0x40000, 0x10000, 0xd80a49ce )
  2547.     ROM_LOAD( "el07.bin",    0x60000, 0x10000, 0x6d771fc3 )
  2548.  
  2549.     ROM_REGION( 0x80000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* tiles 2 */
  2550.     ROM_LOAD( "el08.bin",    0x00000, 0x08000, 0xcb0dcf4c )
  2551.     ROM_CONTINUE(            0x40000, 0x08000 )
  2552.     ROM_LOAD( "el09.bin",    0x20000, 0x08000, 0x1fae5be7 )
  2553.     ROM_CONTINUE(            0x60000, 0x08000 )
  2554. ROM_END
  2555.  
  2556. ROM_START( cobracmj )
  2557.     ROM_REGION( 0x30000, REGION_CPU1 )
  2558.     ROM_LOAD( "eh-11.rom",    0x08000, 0x08000, 0x868637e1 )
  2559.     ROM_LOAD( "eh-12.rom",    0x10000, 0x10000, 0x7c878a83 )
  2560.     ROM_LOAD( "el13.bin",     0x20000, 0x10000, 0x04505acb )
  2561.  
  2562.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  2563.     ROM_LOAD( "eh-10.rom",    0x8000,  0x8000,  0x62ca5e89 )
  2564.  
  2565.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2566.     ROM_LOAD( "el14.bin",    0x00000, 0x08000, 0x47246177 )
  2567.  
  2568.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2569.     ROM_LOAD( "eh-00.rom",    0x00000, 0x10000, 0xd96b6797 )
  2570.     ROM_LOAD( "eh-01.rom",    0x20000, 0x10000, 0x3fef9c02 )
  2571.     ROM_LOAD( "eh-02.rom",    0x40000, 0x10000, 0xbfae6c34 )
  2572.     ROM_LOAD( "eh-03.rom",    0x60000, 0x10000, 0xd56790f8 )
  2573.  
  2574.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles 1 */
  2575.     ROM_LOAD( "el05.bin",    0x00000, 0x10000, 0x1c4f6033 )
  2576.     ROM_LOAD( "el06.bin",    0x20000, 0x10000, 0xd24ba794 )
  2577.     ROM_LOAD( "el04.bin",    0x40000, 0x10000, 0xd80a49ce )
  2578.     ROM_LOAD( "el07.bin",    0x60000, 0x10000, 0x6d771fc3 )
  2579.  
  2580.     ROM_REGION( 0x80000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* tiles 2 */
  2581.     ROM_LOAD( "el08.bin",    0x00000, 0x08000, 0xcb0dcf4c )
  2582.     ROM_CONTINUE(            0x40000, 0x08000 )
  2583.     ROM_LOAD( "el09.bin",    0x20000, 0x08000, 0x1fae5be7 )
  2584.     ROM_CONTINUE(            0x60000, 0x08000 )
  2585. ROM_END
  2586.  
  2587. ROM_START( ghostb )
  2588.     ROM_REGION( 0x50000, REGION_CPU1 )
  2589.     ROM_LOAD( "dz-01.rom", 0x08000, 0x08000, 0x7c5bb4b1 )
  2590.     ROM_LOAD( "dz-02.rom", 0x10000, 0x10000, 0x8e117541 )
  2591.     ROM_LOAD( "dz-03.rom", 0x20000, 0x10000, 0x5606a8f4 )
  2592.     ROM_LOAD( "dz-04.rom", 0x30000, 0x10000, 0xd09bad99 )
  2593.     ROM_LOAD( "dz-05.rom", 0x40000, 0x10000, 0x0315f691 )
  2594.  
  2595.     ROM_REGION( 2*0x10000, REGION_CPU2 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2596.     ROM_LOAD( "dz-06.rom", 0x8000, 0x8000, 0x798f56df )
  2597.  
  2598.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2599.     ROM_LOAD( "dz-00.rom", 0x00000, 0x08000, 0x992b4f31 )
  2600.  
  2601.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2602.     ROM_LOAD( "dz-15.rom", 0x00000, 0x10000, 0xa01a5fd9 )
  2603.     ROM_LOAD( "dz-16.rom", 0x10000, 0x10000, 0x5a9a344a )
  2604.     ROM_LOAD( "dz-12.rom", 0x20000, 0x10000, 0x817fae99 )
  2605.     ROM_LOAD( "dz-14.rom", 0x30000, 0x10000, 0x0abbf76d )
  2606.     ROM_LOAD( "dz-11.rom", 0x40000, 0x10000, 0xa5e19c24 )
  2607.     ROM_LOAD( "dz-13.rom", 0x50000, 0x10000, 0x3e7c0405 )
  2608.     ROM_LOAD( "dz-17.rom", 0x60000, 0x10000, 0x40361b8b )
  2609.     ROM_LOAD( "dz-18.rom", 0x70000, 0x10000, 0x8d219489 )
  2610.  
  2611.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2612.     ROM_LOAD( "dz-07.rom", 0x00000, 0x10000, 0xe7455167 )
  2613.     ROM_LOAD( "dz-08.rom", 0x10000, 0x10000, 0x32f9ddfe )
  2614.     ROM_LOAD( "dz-09.rom", 0x20000, 0x10000, 0xbb6efc02 )
  2615.     ROM_LOAD( "dz-10.rom", 0x30000, 0x10000, 0x6ef9963b )
  2616.  
  2617.     ROM_REGION( 0x0800, REGION_PROMS )
  2618.     ROM_LOAD( "dz19a.10d", 0x0000, 0x0400, 0x47e1f83b )
  2619.     ROM_LOAD( "dz20a.11d", 0x0400, 0x0400, 0xd8fe2d99 )
  2620. ROM_END
  2621.  
  2622. ROM_START( ghostb3 )
  2623.     ROM_REGION( 0x50000, REGION_CPU1 )
  2624.     ROM_LOAD( "dz01-3b",   0x08000, 0x08000, 0xc8cc862a )
  2625.     ROM_LOAD( "dz-02.rom", 0x10000, 0x10000, 0x8e117541 )
  2626.     ROM_LOAD( "dz-03.rom", 0x20000, 0x10000, 0x5606a8f4 )
  2627.     ROM_LOAD( "dz04-1",    0x30000, 0x10000, 0x3c3eb09f )
  2628.     ROM_LOAD( "dz05",      0x40000, 0x10000, 0xb4971d33 )
  2629.  
  2630.     ROM_REGION( 2*0x10000, REGION_CPU2 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2631.     ROM_LOAD( "dz-06.rom", 0x8000, 0x8000, 0x798f56df )
  2632.  
  2633.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2634.     ROM_LOAD( "dz-00.rom", 0x00000, 0x08000, 0x992b4f31 )
  2635.  
  2636.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2637.     ROM_LOAD( "dz-15.rom", 0x00000, 0x10000, 0xa01a5fd9 )
  2638.     ROM_LOAD( "dz-16.rom", 0x10000, 0x10000, 0x5a9a344a )
  2639.     ROM_LOAD( "dz-12.rom", 0x20000, 0x10000, 0x817fae99 )
  2640.     ROM_LOAD( "dz-14.rom", 0x30000, 0x10000, 0x0abbf76d )
  2641.     ROM_LOAD( "dz-11.rom", 0x40000, 0x10000, 0xa5e19c24 )
  2642.     ROM_LOAD( "dz-13.rom", 0x50000, 0x10000, 0x3e7c0405 )
  2643.     ROM_LOAD( "dz-17.rom", 0x60000, 0x10000, 0x40361b8b )
  2644.     ROM_LOAD( "dz-18.rom", 0x70000, 0x10000, 0x8d219489 )
  2645.  
  2646.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2647.     ROM_LOAD( "dz-07.rom", 0x00000, 0x10000, 0xe7455167 )
  2648.     ROM_LOAD( "dz-08.rom", 0x10000, 0x10000, 0x32f9ddfe )
  2649.     ROM_LOAD( "dz-09.rom", 0x20000, 0x10000, 0xbb6efc02 )
  2650.     ROM_LOAD( "dz-10.rom", 0x30000, 0x10000, 0x6ef9963b )
  2651.  
  2652.     ROM_REGION( 0x0800, REGION_PROMS )
  2653.     ROM_LOAD( "dz19a.10d", 0x0000, 0x0400, 0x47e1f83b )
  2654.     ROM_LOAD( "dz20a.11d", 0x0400, 0x0400, 0xd8fe2d99 )
  2655. ROM_END
  2656.  
  2657. ROM_START( meikyuh )
  2658.     ROM_REGION( 0x40000, REGION_CPU1 )
  2659.     ROM_LOAD( "dw-01.rom", 0x08000, 0x08000, 0x87610c39 )
  2660.     ROM_LOAD( "dw-02.rom", 0x10000, 0x10000, 0x40c9b0b8 )
  2661.     ROM_LOAD( "dz-03.rom", 0x20000, 0x10000, 0x5606a8f4 )
  2662.     ROM_LOAD( "dw-04.rom", 0x30000, 0x10000, 0x235c0c36 )
  2663.  
  2664.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  2665.     ROM_LOAD( "dw-05.rom", 0x8000, 0x8000, 0xc28c4d82 )
  2666.  
  2667.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2668.     ROM_LOAD( "dw-00.rom", 0x00000, 0x8000, 0x3d25f15c )
  2669.  
  2670.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2671.     ROM_LOAD( "dw-14.rom", 0x00000, 0x10000, 0x9b0dbfa9 )
  2672.     ROM_LOAD( "dw-15.rom", 0x10000, 0x10000, 0x95683fda )
  2673.     ROM_LOAD( "dw-11.rom", 0x20000, 0x10000, 0x1b1fcca7 )
  2674.     ROM_LOAD( "dw-13.rom", 0x30000, 0x10000, 0xe7413056 )
  2675.     ROM_LOAD( "dw-10.rom", 0x40000, 0x10000, 0x57667546 )
  2676.     ROM_LOAD( "dw-12.rom", 0x50000, 0x10000, 0x4c548db8 )
  2677.     ROM_LOAD( "dw-16.rom", 0x60000, 0x10000, 0xe5bcf927 )
  2678.     ROM_LOAD( "dw-17.rom", 0x70000, 0x10000, 0x9e10f723 )
  2679.  
  2680.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2681.     ROM_LOAD( "dw-06.rom", 0x00000, 0x10000, 0xb65e029d )
  2682.     ROM_LOAD( "dw-07.rom", 0x10000, 0x10000, 0x668d995d )
  2683.     ROM_LOAD( "dw-08.rom", 0x20000, 0x10000, 0xbb2cf4a0 )
  2684.     ROM_LOAD( "dw-09.rom", 0x30000, 0x10000, 0x6a528d13 )
  2685.  
  2686.     ROM_REGION( 0x0800, REGION_PROMS )
  2687.     ROM_LOAD( "dz19a.10d", 0x0000, 0x0400, 0x00000000 ) /* Not the real ones! */
  2688.     ROM_LOAD( "dz20a.11d", 0x0400, 0x0400, 0x00000000 ) /* These are from ghostbusters */
  2689. ROM_END
  2690.  
  2691. ROM_START( srdarwin )
  2692.     ROM_REGION( 0x28000, REGION_CPU1 )
  2693.     ROM_LOAD( "dy_01.rom", 0x20000, 0x08000, 0x1eeee4ff )
  2694.     ROM_CONTINUE(          0x08000, 0x08000 )
  2695.     ROM_LOAD( "dy_00.rom", 0x10000, 0x10000, 0x2bf6b461 )
  2696.  
  2697.     ROM_REGION( 2*0x10000, REGION_CPU2 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2698.     ROM_LOAD( "dy_04.rom", 0x8000, 0x8000, 0x2ae3591c )
  2699.  
  2700.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2701.     ROM_LOAD( "dy_05.rom", 0x00000, 0x4000, 0x8780e8a3 )
  2702.  
  2703.     ROM_REGION( 0x30000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2704.     ROM_LOAD( "dy_07.rom", 0x00000, 0x8000, 0x97eaba60 )
  2705.     ROM_LOAD( "dy_06.rom", 0x08000, 0x8000, 0xc279541b )
  2706.     ROM_LOAD( "dy_09.rom", 0x10000, 0x8000, 0xd30d1745 )
  2707.     ROM_LOAD( "dy_08.rom", 0x18000, 0x8000, 0x71d645fd )
  2708.     ROM_LOAD( "dy_11.rom", 0x20000, 0x8000, 0xfd9ccc5b )
  2709.     ROM_LOAD( "dy_10.rom", 0x28000, 0x8000, 0x88770ab8 )
  2710.  
  2711.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2712.     ROM_LOAD( "dy_03.rom", 0x00000, 0x4000, 0x44f2a4f9 )
  2713.     ROM_CONTINUE(          0x10000, 0x4000 )
  2714.     ROM_CONTINUE(          0x20000, 0x4000 )
  2715.     ROM_CONTINUE(          0x30000, 0x4000 )
  2716.     ROM_LOAD( "dy_02.rom", 0x08000, 0x4000, 0x522d9a9e )
  2717.     ROM_CONTINUE(          0x18000, 0x4000 )
  2718.     ROM_CONTINUE(          0x28000, 0x4000 )
  2719.     ROM_CONTINUE(          0x38000, 0x4000 )
  2720. ROM_END
  2721.  
  2722. ROM_START( gondo )
  2723.     ROM_REGION( 0x40000, REGION_CPU1 )
  2724.     ROM_LOAD( "dt-00.256", 0x08000, 0x08000, 0xa8cf9118 )
  2725.     ROM_LOAD( "dt-01.512", 0x10000, 0x10000, 0xc39bb877 )
  2726.     ROM_LOAD( "dt-02.512", 0x20000, 0x10000, 0xbb5e674b )
  2727.     ROM_LOAD( "dt-03.512", 0x30000, 0x10000, 0x99c32b13 )
  2728.  
  2729.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  2730.     ROM_LOAD( "dt-05.256", 0x8000, 0x8000, 0xec08aa29 )
  2731.  
  2732.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2733.     ROM_LOAD( "dt-14.256", 0x00000, 0x08000, 0x4bef16e1 )
  2734.  
  2735.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2736.     ROM_LOAD( "dt-19.512", 0x00000, 0x10000, 0xda2abe4b )
  2737.     ROM_LOAD( "dt-20.256", 0x10000, 0x08000, 0x42d01002 )
  2738.     ROM_LOAD( "dt-16.512", 0x20000, 0x10000, 0xe9955d8f )
  2739.     ROM_LOAD( "dt-18.256", 0x30000, 0x08000, 0xc0c5df1c )
  2740.     ROM_LOAD( "dt-15.512", 0x40000, 0x10000, 0xa54b2eb6 )
  2741.     ROM_LOAD( "dt-17.256", 0x50000, 0x08000, 0x3bbcff0d )
  2742.     ROM_LOAD( "dt-21.512", 0x60000, 0x10000, 0x1c5f682d )
  2743.     ROM_LOAD( "dt-22.256", 0x70000, 0x08000, 0xc1876a5f )
  2744.  
  2745.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2746.     ROM_LOAD( "dt-08.512", 0x00000, 0x08000, 0xaec483f5 )
  2747.     ROM_CONTINUE(          0x10000, 0x08000 )
  2748.     ROM_LOAD( "dt-09.256", 0x08000, 0x08000, 0x446f0ce0 )
  2749.     ROM_LOAD( "dt-06.512", 0x20000, 0x08000, 0x3fe1527f )
  2750.     ROM_CONTINUE(          0x30000, 0x08000 )
  2751.     ROM_LOAD( "dt-07.256", 0x28000, 0x08000, 0x61f9bce5 )
  2752.     ROM_LOAD( "dt-12.512", 0x40000, 0x08000, 0x1a72ca8d )
  2753.     ROM_CONTINUE(          0x50000, 0x08000 )
  2754.     ROM_LOAD( "dt-13.256", 0x48000, 0x08000, 0xccb81aec )
  2755.     ROM_LOAD( "dt-10.512", 0x60000, 0x08000, 0xcfcfc9ed )
  2756.     ROM_CONTINUE(          0x70000, 0x08000 )
  2757.     ROM_LOAD( "dt-11.256", 0x68000, 0x08000, 0x53e9cf17 )
  2758. ROM_END
  2759.  
  2760. ROM_START( makyosen )
  2761.     ROM_REGION( 0x40000, REGION_CPU1 )
  2762.     ROM_LOAD( "ds00",      0x08000, 0x08000, 0x33bb16fe )
  2763.     ROM_LOAD( "dt-01.512", 0x10000, 0x10000, 0xc39bb877 )
  2764.     ROM_LOAD( "ds02",      0x20000, 0x10000, 0x925307a4 )
  2765.     ROM_LOAD( "ds03",      0x30000, 0x10000, 0x9c0fcbf6 )
  2766.  
  2767.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  2768.     ROM_LOAD( "ds05",      0x8000, 0x8000, 0xe6e28ca9 )
  2769.  
  2770.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2771.     ROM_LOAD( "ds14",      0x00000, 0x08000, 0x00cbe9c8 )
  2772.  
  2773.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2774.     ROM_LOAD( "dt-19.512", 0x00000, 0x10000, 0xda2abe4b )
  2775.     ROM_LOAD( "ds20",      0x10000, 0x08000, 0x0eef7f56 )
  2776.     ROM_LOAD( "dt-16.512", 0x20000, 0x10000, 0xe9955d8f )
  2777.     ROM_LOAD( "ds18",      0x30000, 0x08000, 0x2b2d1468 )
  2778.     ROM_LOAD( "dt-15.512", 0x40000, 0x10000, 0xa54b2eb6 )
  2779.     ROM_LOAD( "ds17",      0x50000, 0x08000, 0x75ae349a )
  2780.     ROM_LOAD( "dt-21.512", 0x60000, 0x10000, 0x1c5f682d )
  2781.     ROM_LOAD( "ds22",      0x70000, 0x08000, 0xc8ffb148 )
  2782.  
  2783.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2784.     ROM_LOAD( "dt-08.512", 0x00000, 0x08000, 0xaec483f5 )
  2785.     ROM_CONTINUE(          0x10000, 0x08000 )
  2786.     ROM_LOAD( "dt-09.256", 0x08000, 0x08000, 0x446f0ce0 )
  2787.     ROM_LOAD( "dt-06.512", 0x20000, 0x08000, 0x3fe1527f )
  2788.     ROM_CONTINUE(          0x30000, 0x08000 )
  2789.     ROM_LOAD( "dt-07.256", 0x28000, 0x08000, 0x61f9bce5 )
  2790.     ROM_LOAD( "dt-12.512", 0x40000, 0x08000, 0x1a72ca8d )
  2791.     ROM_CONTINUE(          0x50000, 0x08000 )
  2792.     ROM_LOAD( "dt-13.256", 0x48000, 0x08000, 0xccb81aec )
  2793.     ROM_LOAD( "dt-10.512", 0x60000, 0x08000, 0xcfcfc9ed )
  2794.     ROM_CONTINUE(          0x70000, 0x08000 )
  2795.     ROM_LOAD( "dt-11.256", 0x68000, 0x08000, 0x53e9cf17 )
  2796. ROM_END
  2797.  
  2798. ROM_START( oscar )
  2799.     ROM_REGION( 0x20000, REGION_CPU1 )
  2800.     ROM_LOAD( "ed10", 0x08000, 0x08000, 0xf9b0d4d4 )
  2801.     ROM_LOAD( "ed09", 0x10000, 0x10000, 0xe2d4bba9 )
  2802.  
  2803.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2804.     ROM_LOAD( "ed11", 0x0000, 0x10000,  0x10e5d919 )
  2805.  
  2806.     ROM_REGION( 2*0x10000, REGION_CPU3 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2807.     ROM_LOAD( "ed12", 0x8000, 0x8000,  0x432031c5 )
  2808.  
  2809.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2810.     ROM_LOAD( "ed08", 0x00000, 0x04000, 0x308ac264 )
  2811.  
  2812.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2813.     ROM_LOAD( "ed04", 0x00000, 0x10000, 0x416a791b )
  2814.     ROM_LOAD( "ed05", 0x20000, 0x10000, 0xfcdba431 )
  2815.     ROM_LOAD( "ed06", 0x40000, 0x10000, 0x7d50bebc )
  2816.     ROM_LOAD( "ed07", 0x60000, 0x10000, 0x8fdf0fa5 )
  2817.  
  2818.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2819.     ROM_LOAD( "ed01", 0x00000, 0x10000, 0xd3a58e9e )
  2820.     ROM_LOAD( "ed03", 0x20000, 0x10000, 0x4fc4fb0f )
  2821.     ROM_LOAD( "ed00", 0x40000, 0x10000, 0xac201f2d )
  2822.     ROM_LOAD( "ed02", 0x60000, 0x10000, 0x7ddc5651 )
  2823. ROM_END
  2824.  
  2825. ROM_START( oscarj0 )
  2826.     ROM_REGION( 0x20000, REGION_CPU1 )
  2827.     ROM_LOAD( "du10", 0x08000, 0x08000, 0x120040d8 )
  2828.     ROM_LOAD( "ed09", 0x10000, 0x10000, 0xe2d4bba9 )
  2829.  
  2830.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2831.     ROM_LOAD( "du11", 0x0000, 0x10000, 0xff45c440 )
  2832.  
  2833.     ROM_REGION( 2*0x10000, REGION_CPU3 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2834.     ROM_LOAD( "ed12", 0x8000, 0x8000, 0x432031c5 )
  2835.  
  2836.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2837.     ROM_LOAD( "ed08", 0x00000, 0x04000, 0x308ac264 )
  2838.  
  2839.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2840.     ROM_LOAD( "ed04", 0x00000, 0x10000, 0x416a791b )
  2841.     ROM_LOAD( "ed05", 0x20000, 0x10000, 0xfcdba431 )
  2842.     ROM_LOAD( "ed06", 0x40000, 0x10000, 0x7d50bebc )
  2843.     ROM_LOAD( "ed07", 0x60000, 0x10000, 0x8fdf0fa5 )
  2844.  
  2845.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2846.     ROM_LOAD( "ed01", 0x00000, 0x10000, 0xd3a58e9e )
  2847.     ROM_LOAD( "ed03", 0x20000, 0x10000, 0x4fc4fb0f )
  2848.     ROM_LOAD( "ed00", 0x40000, 0x10000, 0xac201f2d )
  2849.     ROM_LOAD( "ed02", 0x60000, 0x10000, 0x7ddc5651 )
  2850. ROM_END
  2851.  
  2852. ROM_START( oscarj1 )
  2853.     ROM_REGION( 0x20000, REGION_CPU1 )
  2854.     ROM_LOAD( "oscr10-1.bin", 0x08000, 0x08000, 0x4ebc9f7a ) /* DU10-1 */
  2855.     ROM_LOAD( "ed09", 0x10000, 0x10000, 0xe2d4bba9 )
  2856.  
  2857.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2858.     ROM_LOAD( "du11", 0x0000, 0x10000, 0xff45c440 )
  2859.  
  2860.     ROM_REGION( 2*0x10000, REGION_CPU3 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2861.     ROM_LOAD( "ed12", 0x8000, 0x8000, 0x432031c5 )
  2862.  
  2863.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2864.     ROM_LOAD( "ed08", 0x00000, 0x04000, 0x308ac264 )
  2865.  
  2866.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2867.     ROM_LOAD( "ed04", 0x00000, 0x10000, 0x416a791b )
  2868.     ROM_LOAD( "ed05", 0x20000, 0x10000, 0xfcdba431 )
  2869.     ROM_LOAD( "ed06", 0x40000, 0x10000, 0x7d50bebc )
  2870.     ROM_LOAD( "ed07", 0x60000, 0x10000, 0x8fdf0fa5 )
  2871.  
  2872.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2873.     ROM_LOAD( "ed01", 0x00000, 0x10000, 0xd3a58e9e )
  2874.     ROM_LOAD( "ed03", 0x20000, 0x10000, 0x4fc4fb0f )
  2875.     ROM_LOAD( "ed00", 0x40000, 0x10000, 0xac201f2d )
  2876.     ROM_LOAD( "ed02", 0x60000, 0x10000, 0x7ddc5651 )
  2877. ROM_END
  2878.  
  2879. ROM_START( oscarj )
  2880.     ROM_REGION( 0x20000, REGION_CPU1 )
  2881.     ROM_LOAD( "oscr10-2.bin", 0x08000, 0x08000, 0x114e898d ) /* DU10-2 */
  2882.     ROM_LOAD( "ed09", 0x10000, 0x10000, 0xe2d4bba9 )
  2883.  
  2884.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2885.     ROM_LOAD( "du11", 0x0000, 0x10000, 0xff45c440 )
  2886.  
  2887.     ROM_REGION( 2*0x10000, REGION_CPU3 )    /* 64K for sound CPU + 64k for decrypted opcodes */
  2888.     ROM_LOAD( "ed12", 0x8000, 0x8000, 0x432031c5 )
  2889.  
  2890.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2891.     ROM_LOAD( "ed08", 0x00000, 0x04000, 0x308ac264 )
  2892.  
  2893.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2894.     ROM_LOAD( "ed04", 0x00000, 0x10000, 0x416a791b )
  2895.     ROM_LOAD( "ed05", 0x20000, 0x10000, 0xfcdba431 )
  2896.     ROM_LOAD( "ed06", 0x40000, 0x10000, 0x7d50bebc )
  2897.     ROM_LOAD( "ed07", 0x60000, 0x10000, 0x8fdf0fa5 )
  2898.  
  2899.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2900.     ROM_LOAD( "ed01", 0x00000, 0x10000, 0xd3a58e9e )
  2901.     ROM_LOAD( "ed03", 0x20000, 0x10000, 0x4fc4fb0f )
  2902.     ROM_LOAD( "ed00", 0x40000, 0x10000, 0xac201f2d )
  2903.     ROM_LOAD( "ed02", 0x60000, 0x10000, 0x7ddc5651 )
  2904. ROM_END
  2905.  
  2906. ROM_START( lastmiss )
  2907.     ROM_REGION( 0x20000, REGION_CPU1 )
  2908.     ROM_LOAD( "dl03-6",      0x08000, 0x08000, 0x47751a5e ) /* Rev 6 roms */
  2909.     ROM_LOAD( "lm_dl04.rom", 0x10000, 0x10000, 0x7dea1552 )
  2910.  
  2911.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2912.     ROM_LOAD( "lm_dl02.rom", 0x0000, 0x10000, 0xec9b5daf )
  2913.  
  2914.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64K for sound CPU */
  2915.     ROM_LOAD( "lm_dl05.rom", 0x8000, 0x8000, 0x1a5df8c0 )
  2916.  
  2917.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2918.     ROM_LOAD( "lm_dl01.rom", 0x00000, 0x2000, 0xf3787a5d )
  2919.     ROM_CONTINUE(             0x06000, 0x2000 )
  2920.     ROM_CONTINUE(              0x04000, 0x2000 )
  2921.     ROM_CONTINUE(              0x02000, 0x2000 )
  2922.  
  2923.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2924.     ROM_LOAD( "lm_dl11.rom", 0x00000, 0x08000, 0x36579d3b )
  2925.     ROM_LOAD( "lm_dl12.rom", 0x20000, 0x08000, 0x2ba6737e )
  2926.     ROM_LOAD( "lm_dl13.rom", 0x40000, 0x08000, 0x39a7dc93 )
  2927.     ROM_LOAD( "lm_dl10.rom", 0x60000, 0x08000, 0xfe275ea8 )
  2928.  
  2929.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2930.     ROM_LOAD( "lm_dl09.rom", 0x00000, 0x10000, 0x6a5a0c5d )
  2931.     ROM_LOAD( "lm_dl08.rom", 0x20000, 0x10000, 0x3b38cfce )
  2932.     ROM_LOAD( "lm_dl07.rom", 0x40000, 0x10000, 0x1b60604d )
  2933.     ROM_LOAD( "lm_dl06.rom", 0x60000, 0x10000, 0xc43c26a7 )
  2934. ROM_END
  2935.  
  2936. ROM_START( lastmss2 )
  2937.     ROM_REGION( 0x20000, REGION_CPU1 )
  2938.     ROM_LOAD( "lm_dl03.rom", 0x08000, 0x08000, 0x357f5f6b ) /* Rev 5 roms */
  2939.     ROM_LOAD( "lm_dl04.rom", 0x10000, 0x10000, 0x7dea1552 )
  2940.  
  2941.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2942.     ROM_LOAD( "lm_dl02.rom", 0x0000, 0x10000, 0xec9b5daf )
  2943.  
  2944.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64K for sound CPU */
  2945.     ROM_LOAD( "lm_dl05.rom", 0x8000, 0x8000, 0x1a5df8c0 )
  2946.  
  2947.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2948.     ROM_LOAD( "lm_dl01.rom", 0x00000, 0x2000, 0xf3787a5d )
  2949.     ROM_CONTINUE(             0x06000, 0x2000 )
  2950.     ROM_CONTINUE(              0x04000, 0x2000 )
  2951.     ROM_CONTINUE(              0x02000, 0x2000 )
  2952.  
  2953.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2954.     ROM_LOAD( "lm_dl11.rom", 0x00000, 0x08000, 0x36579d3b )
  2955.     ROM_LOAD( "lm_dl12.rom", 0x20000, 0x08000, 0x2ba6737e )
  2956.     ROM_LOAD( "lm_dl13.rom", 0x40000, 0x08000, 0x39a7dc93 )
  2957.     ROM_LOAD( "lm_dl10.rom", 0x60000, 0x08000, 0xfe275ea8 )
  2958.  
  2959.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2960.     ROM_LOAD( "lm_dl09.rom", 0x00000, 0x10000, 0x6a5a0c5d )
  2961.     ROM_LOAD( "lm_dl08.rom", 0x20000, 0x10000, 0x3b38cfce )
  2962.     ROM_LOAD( "lm_dl07.rom", 0x40000, 0x10000, 0x1b60604d )
  2963.     ROM_LOAD( "lm_dl06.rom", 0x60000, 0x10000, 0xc43c26a7 )
  2964. ROM_END
  2965.  
  2966. ROM_START( shackled )
  2967.     ROM_REGION( 0x48000, REGION_CPU1 )
  2968.     ROM_LOAD( "dk-02.rom", 0x08000, 0x08000, 0x87f8fa85 )
  2969.     ROM_LOAD( "dk-06.rom", 0x10000, 0x10000, 0x69ad62d1 )
  2970.     ROM_LOAD( "dk-05.rom", 0x20000, 0x10000, 0x598dd128 )
  2971.     ROM_LOAD( "dk-04.rom", 0x30000, 0x10000, 0x36d305d4 )
  2972.     ROM_LOAD( "dk-03.rom", 0x40000, 0x08000, 0x6fd90fd1 )
  2973.  
  2974.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  2975.     ROM_LOAD( "dk-01.rom", 0x00000, 0x10000, 0x71fe3bda )
  2976.  
  2977.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64K for sound CPU */
  2978.     ROM_LOAD( "dk-07.rom", 0x08000, 0x08000, 0x887e4bcc )
  2979.  
  2980.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  2981.     ROM_LOAD( "dk-00.rom", 0x00000, 0x08000, 0x69b975aa )
  2982.  
  2983.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  2984.     ROM_LOAD( "dk-12.rom", 0x00000, 0x10000, 0x615c2371 )
  2985.     ROM_LOAD( "dk-13.rom", 0x10000, 0x10000, 0x479aa503 )
  2986.     ROM_LOAD( "dk-14.rom", 0x20000, 0x10000, 0xcdc24246 )
  2987.     ROM_LOAD( "dk-15.rom", 0x30000, 0x10000, 0x88db811b )
  2988.     ROM_LOAD( "dk-16.rom", 0x40000, 0x10000, 0x061a76bd )
  2989.     ROM_LOAD( "dk-17.rom", 0x50000, 0x10000, 0xa6c5d8af )
  2990.     ROM_LOAD( "dk-18.rom", 0x60000, 0x10000, 0x4d466757 )
  2991.     ROM_LOAD( "dk-19.rom", 0x70000, 0x10000, 0x1911e83e )
  2992.  
  2993.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  2994.     ROM_LOAD( "dk-11.rom", 0x00000, 0x10000, 0x5cf5719f )
  2995.     ROM_LOAD( "dk-10.rom", 0x20000, 0x10000, 0x408e6d08 )
  2996.     ROM_LOAD( "dk-09.rom", 0x40000, 0x10000, 0xc1557fac )
  2997.     ROM_LOAD( "dk-08.rom", 0x60000, 0x10000, 0x5e54e9f5 )
  2998. ROM_END
  2999.  
  3000. ROM_START( breywood )
  3001.     ROM_REGION( 0x48000, REGION_CPU1 )
  3002.     ROM_LOAD( "7.bin", 0x08000, 0x08000, 0xc19856b9 )
  3003.     ROM_LOAD( "3.bin", 0x10000, 0x10000, 0x2860ea02 )
  3004.     ROM_LOAD( "4.bin", 0x20000, 0x10000, 0x0fdd915e )
  3005.     ROM_LOAD( "5.bin", 0x30000, 0x10000, 0x71036579 )
  3006.     ROM_LOAD( "6.bin", 0x40000, 0x08000, 0x308f4893 )
  3007.  
  3008.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  3009.     ROM_LOAD( "8.bin", 0x0000, 0x10000,  0x3d9fb623 )
  3010.  
  3011.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64K for sound CPU */
  3012.     ROM_LOAD( "2.bin", 0x8000, 0x8000,  0x4a471c38 )
  3013.  
  3014.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  3015.     ROM_LOAD( "1.bin",  0x00000, 0x08000, 0x815a891a )
  3016.  
  3017.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  3018.     ROM_LOAD( "20.bin", 0x00000, 0x10000, 0x2b7634f2 )
  3019.     ROM_LOAD( "19.bin", 0x10000, 0x10000, 0x4530a952 )
  3020.     ROM_LOAD( "18.bin", 0x20000, 0x10000, 0x87c28833 )
  3021.     ROM_LOAD( "17.bin", 0x30000, 0x10000, 0xbfb43a4d )
  3022.     ROM_LOAD( "16.bin", 0x40000, 0x10000, 0xf9848cc4 )
  3023.     ROM_LOAD( "15.bin", 0x50000, 0x10000, 0xbaa3d218 )
  3024.     ROM_LOAD( "14.bin", 0x60000, 0x10000, 0x12afe533 )
  3025.     ROM_LOAD( "13.bin", 0x70000, 0x10000, 0x03373755 )
  3026.  
  3027.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  3028.     ROM_LOAD( "9.bin",  0x00000, 0x10000, 0x067e2a43 )
  3029.     ROM_LOAD( "10.bin", 0x20000, 0x10000, 0xc19733aa )
  3030.     ROM_LOAD( "11.bin", 0x40000, 0x10000, 0xe37d5dbe )
  3031.     ROM_LOAD( "12.bin", 0x60000, 0x10000, 0xbeee880f )
  3032. ROM_END
  3033.  
  3034. ROM_START( csilver )
  3035.     ROM_REGION( 0x48000, REGION_CPU1 )
  3036.     ROM_LOAD( "a4", 0x08000, 0x08000, 0x02dd8cfc )
  3037.     ROM_LOAD( "a2", 0x10000, 0x10000, 0x570fb50c )
  3038.     ROM_LOAD( "a3", 0x20000, 0x10000, 0x58625890 )
  3039.  
  3040.     ROM_REGION( 0x10000, REGION_CPU2 )    /* CPU 2, 1st 16k is empty */
  3041.     ROM_LOAD( "a5", 0x0000, 0x10000,  0x29432691 )
  3042.  
  3043.     ROM_REGION( 0x18000, REGION_CPU3 )    /* 64K for sound CPU */
  3044.     ROM_LOAD( "a6", 0x10000, 0x08000,  0xeb32cf25 )
  3045.     ROM_CONTINUE(   0x08000, 0x08000 )
  3046.  
  3047.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  3048.     ROM_LOAD( "a1",  0x00000, 0x08000, 0xf01ef985 )
  3049.  
  3050.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites (3bpp) */
  3051.     ROM_LOAD( "b5",  0x00000, 0x10000, 0x80f07915 )
  3052.     /* 0x10000-0x1ffff empy */
  3053.     ROM_LOAD( "b4",  0x20000, 0x10000, 0xd32c02e7 )
  3054.     /* 0x30000-0x3ffff empy */
  3055.     ROM_LOAD( "b3",  0x40000, 0x10000, 0xac78b76b )
  3056.     /* 0x50000-0x5ffff empy */
  3057.     /* 0x60000-0x7ffff empy (no 4th plane) */
  3058.  
  3059.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles (3bpp) */
  3060.     ROM_LOAD( "a7",  0x00000, 0x10000, 0xb6fb208c )
  3061.     ROM_LOAD( "a8",  0x10000, 0x10000, 0xee3e1817 )
  3062.     ROM_LOAD( "a9",  0x20000, 0x10000, 0x705900fe )
  3063.     ROM_LOAD( "a10", 0x30000, 0x10000, 0x3192571d )
  3064.     ROM_LOAD( "b1",  0x40000, 0x10000, 0x3ef77a32 )
  3065.     ROM_LOAD( "b2",  0x50000, 0x10000, 0x9cf3d5b8 )
  3066. ROM_END
  3067.  
  3068. ROM_START( garyoret )
  3069.     ROM_REGION( 0x58000, REGION_CPU1 )
  3070.     ROM_LOAD( "dv00", 0x08000, 0x08000, 0xcceaaf05 )
  3071.     ROM_LOAD( "dv01", 0x10000, 0x10000, 0xc33fc18a )
  3072.     ROM_LOAD( "dv02", 0x20000, 0x10000, 0xf9e26ce7 )
  3073.     ROM_LOAD( "dv03", 0x30000, 0x10000, 0x55d8d699 )
  3074.     ROM_LOAD( "dv04", 0x40000, 0x10000, 0xed3d00ee )
  3075.  
  3076.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64K for sound CPU */
  3077.     ROM_LOAD( "dv05", 0x08000, 0x08000, 0xc97c347f )
  3078.  
  3079.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* characters */
  3080.     ROM_LOAD( "dv14", 0x00000, 0x08000, 0xfb2bc581 )    /* Characters */
  3081.  
  3082.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  3083.     ROM_LOAD( "dv22", 0x00000, 0x10000, 0xcef0367e )
  3084.     ROM_LOAD( "dv21", 0x10000, 0x08000, 0x90042fb7 )
  3085.     ROM_LOAD( "dv20", 0x20000, 0x10000, 0x451a2d8c )
  3086.     ROM_LOAD( "dv19", 0x30000, 0x08000, 0x14e1475b )
  3087.     ROM_LOAD( "dv18", 0x40000, 0x10000, 0x7043bead )
  3088.     ROM_LOAD( "dv17", 0x50000, 0x08000, 0x28f449d7 )
  3089.     ROM_LOAD( "dv16", 0x60000, 0x10000, 0x37e4971e )
  3090.     ROM_LOAD( "dv15", 0x70000, 0x08000, 0xca41b6ac )
  3091.  
  3092.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  3093.     ROM_LOAD( "dv08", 0x00000, 0x08000, 0x89c13e15 )
  3094.     ROM_CONTINUE(     0x10000, 0x08000 )
  3095.     ROM_LOAD( "dv09", 0x08000, 0x08000, 0x6a345a23 )
  3096.     ROM_CONTINUE(     0x18000, 0x08000 )
  3097.  
  3098.     ROM_LOAD( "dv06", 0x20000, 0x08000, 0x1eb52a20 )
  3099.     ROM_CONTINUE(     0x30000, 0x08000 )
  3100.     ROM_LOAD( "dv07", 0x28000, 0x08000, 0xe7346ef8 )
  3101.     ROM_CONTINUE(     0x38000, 0x08000 )
  3102.  
  3103.     ROM_LOAD( "dv12", 0x40000, 0x08000, 0x46ba5af4 )
  3104.     ROM_CONTINUE(     0x50000, 0x08000 )
  3105.     ROM_LOAD( "dv13", 0x48000, 0x08000, 0xa7af6dfd )
  3106.     ROM_CONTINUE(     0x58000, 0x08000 )
  3107.  
  3108.     ROM_LOAD( "dv10", 0x60000, 0x08000, 0x68b6d75c )
  3109.     ROM_CONTINUE(     0x70000, 0x08000 )
  3110.     ROM_LOAD( "dv11", 0x68000, 0x08000, 0xb5948aee )
  3111.     ROM_CONTINUE(     0x78000, 0x08000 )
  3112. ROM_END
  3113.  
  3114. /******************************************************************************/
  3115.  
  3116. /* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */
  3117. static void init_deco222(void)
  3118. {
  3119.     int A,sound_cpu,diff;
  3120.     unsigned char *rom;
  3121.  
  3122.     sound_cpu = 1;
  3123.     /* Oscar has three CPUs */
  3124.     if (Machine->drv->cpu[2].cpu_type != 0) sound_cpu = 2;
  3125.  
  3126.     /* bits 5 and 6 of the opcodes are swapped */
  3127.     rom = memory_region(REGION_CPU1+sound_cpu);
  3128.     diff = memory_region_length(REGION_CPU1+sound_cpu) / 2;
  3129.  
  3130.     memory_set_opcode_base(sound_cpu,rom+diff);
  3131.  
  3132.     for (A = 0;A < 0x10000;A++)
  3133.         rom[A + diff] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
  3134. }
  3135.  
  3136. static void init_meikyuh(void)
  3137. {
  3138.     /* Blank out unused garbage in colour prom to avoid colour overflow */
  3139.     unsigned char *RAM = memory_region(REGION_PROMS);
  3140.     memset(RAM+0x20,0,0xe0);
  3141. }
  3142.  
  3143. static void init_ghostb(void)
  3144. {
  3145.     init_deco222();
  3146.     init_meikyuh();
  3147. }
  3148.  
  3149. /******************************************************************************/
  3150.  
  3151. GAME(1988, cobracom, 0,        cobracom, cobracom, 0,       ROT0,   "Data East Corporation", "Cobra-Command (World revision 5)" )
  3152. GAME(1988, cobracmj, cobracom, cobracom, cobracom, 0,       ROT0,   "Data East Corporation", "Cobra-Command (Japan)" )
  3153. GAME(1987, ghostb,   0,        ghostb,   ghostb,   ghostb,  ROT0,   "Data East USA", "The Real Ghostbusters (US 2 Players)" )
  3154. GAME(1987, ghostb3,  ghostb,   ghostb,   ghostb,   ghostb,  ROT0,   "Data East USA", "The Real Ghostbusters (US 3 Players)" )
  3155. GAME(1987, meikyuh,  ghostb,   ghostb,   meikyuh,  meikyuh, ROT0,   "Data East Corporation", "Meikyuu Hunter G (Japan)" )
  3156. GAME(1987, srdarwin, 0,        srdarwin, srdarwin, deco222, ROT270, "Data East Corporation", "Super Real Darwin (Japan)" )
  3157. GAME(1987, gondo,    0,        gondo,    gondo,    0,       ROT270, "Data East USA", "Gondomania (US)" )
  3158. GAME(1987, makyosen, gondo,    gondo,    gondo,    0,       ROT270, "Data East Corporation", "Makyou Senshi (Japan)" )
  3159. GAME(1988, oscar,    0,        oscar,    oscar,    deco222, ROT0,   "Data East USA", "Psycho-Nics Oscar (US)" )
  3160. GAME(1987, oscarj,   oscar,    oscar,    oscar,    deco222, ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 2)" )
  3161. GAME(1987, oscarj1,  oscar,    oscar,    oscar,    deco222, ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 1)" )
  3162. GAME(1987, oscarj0,  oscar,    oscar,    oscar,    deco222, ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 0)" )
  3163. GAME(1986, lastmiss, 0,        lastmiss, lastmiss, 0,       ROT270, "Data East USA", "Last Mission (US revision 6)" )
  3164. GAME(1986, lastmss2, lastmiss, lastmiss, lastmiss, 0,       ROT270, "Data East USA", "Last Mission (US revision 5)" )
  3165. GAME(1986, shackled, 0,        shackled, shackled, 0,       ROT0,   "Data East USA", "Shackled (US)" )
  3166. GAME(1986, breywood, shackled, shackled, shackled, 0,       ROT0,   "Data East Corporation", "Breywood (Japan revision 2)" )
  3167. GAME(1987, csilver,  0,        csilver,  csilver,  0,       ROT0,   "Data East Corporation", "Captain Silver (Japan)" )
  3168. GAME(1987, garyoret, 0,        garyoret, garyoret, 0,       ROT0,   "Data East Corporation", "Garyo Retsuden (Japan)" )
  3169.